Skip to content

fix: E495 on VimEnter with 'verbose'#242

Merged
xuhdev merged 1 commit intoeditorconfig:masterfrom
tomtomjhj:e495
Nov 8, 2024
Merged

fix: E495 on VimEnter with 'verbose'#242
xuhdev merged 1 commit intoeditorconfig:masterfrom
tomtomjhj:e495

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
@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