Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: E495 on VimEnter with 'verbose' #242

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

tomtomjhj
Copy link
Contributor

Problem:
If 'verbose' is non-zero, VimEnter autocmd when starting vim without args raises E495:

Error detected while processing VimEnter Autocommands for "*"..function <SNR>37_UseConfigFiles:
line    6:
E495: No autocommand file name to substitute for "<afile>"

Solution:
Replace <afile> with #n (:help :_#n).

Problem:
If 'verbose' is non-zero, VimEnter autocmd when starting vim without
args raises E495:

    Error detected while processing VimEnter Autocommands for "*"..function <SNR>37_UseConfigFiles:
    line    6:
    E495: No autocommand file name to substitute for "<afile>"

Solution:
Replace "<afile>" with "#n" (:help :_#n).
@xuhdev
Copy link
Member

xuhdev commented Nov 5, 2024

Thanks for the PR. I found the error shows up only if I start vim with no file. Perhaps the root cause of missing an <afile> is caused by the "No Name" buffer?

@tomtomjhj
Copy link
Contributor Author

Perhaps the root cause of missing an <afile> is caused by the "No Name" buffer?

That's my understanding as well.

@xuhdev xuhdev merged commit 3c2813f into editorconfig:master Nov 8, 2024
1 check passed
@tomtomjhj tomtomjhj deleted the e495 branch November 9, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants