…toall
I noticed that
:autocmd! FooBar
:augroup! FooBar
looks slightly different to how the ! is drawn. While the ! for the autocmd case is shown in the same color as autocmd, for :augroup is is shown as VimEventList
In addition, the vim syntax seems to accept doautocmd! and doautoall! (with bang attribute) even so this is not valid.
So let's fix all of those and mark the ! as an error for the the :doautocmd/doautoall case.
cc @dkearns
https://github.com/vim/vim/pull/14906
(6 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks. We need to match vimAutoEventList after a ! so I'd add a dedicated bang group for autocmds like the following.
--- vim.vim 2024-06-04 13:18:27.530178121 +1000 +++ /tmp/vim2.vim 2024-06-04 20:20:11.472645559 +1000 @@ -565,8 +565,9 @@ if !exists("g:vimsyn_noerror") syn match vimAutoBangError contained "!" skipwhite nextgroup=vimAutoEventList endif -syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAugroupBang,vimAutoEventList +syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoBangError,vimAutoEventList +syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList @@ -1106,6 +1107,7 @@ hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand hi def link vimAutoCmd vimCommand + hi def link vimAutoCmdBang vimBang hi def link vimAutoEvent Type hi def link vimAutoCmdMod Special hi def link vimBang vimOper
Patch on top of your changes.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I also found a stash attempting to fix a number of issues with :au. I'll see what I can salvage...
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
do you want to take over this one then? Or shall I squash your patch on top of mine and go ahead merging?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I can take it if you're not in a hurry for the intermediate fix.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
closing as stalled
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()