runtime(vim): Update base syntax, fix indented Vim9 :redir highlighting Commit: https://github.com/vim/vim/commit/57d243e27da804489e256add0398efb9310a4353 Author: Doug Kearns <dougkea...@gmail.com> Date: Thu Sep 18 19:28:18 2025 +0000
runtime(vim): Update base syntax, fix indented Vim9 :redir highlighting Include post operator whitespace in the Vim9 variable assignment lookahead so that "redir =>" doesn't match as an assignment. fixes: #18319 closes: #18323 Signed-off-by: Doug Kearns <dougkea...@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 2d89ce5ca..8230422f1 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> " Doug Kearns <dougkea...@gmail.com> -" Last Change: 2025 Aug 29 +" Last Change: 2025 Sep 18 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -272,9 +272,9 @@ syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimV Vim9 syn match vimVar contained "\<\h\w*\ze<" nextgroup=vim9TypeArgs -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==" -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=" -Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==\%(\s\|$\)" +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=\%(\s\|$\)" +Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<\s" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This diff --git a/runtime/syntax/testdir/dumps/vim_ex_redir_01.dump b/runtime/syntax/testdir/dumps/vim_ex_redir_01.dump index 372c48430..64189fa90 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_redir_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_redir_01.dump @@ -17,4 +17,4 @@ |r+0#af5f00255&|e|d|i|r| +0#0000000&|@+0#e000e06&|a|>+0#af5f00255&@1| +0#0000000&@64 |r+0#af5f00255&|e|d|i|r| +0#0000000&|@+0#e000e06&|A|>+0#af5f00255&@1| +0#0000000&@64 @75 -@57|1|9|,|1| @9|4|8|%| +@57|1|9|,|1| @9|2|5|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_redir_02.dump b/runtime/syntax/testdir/dumps/vim_ex_redir_02.dump index bff02dac0..225197ea2 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_redir_02.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_redir_02.dump @@ -13,8 +13,8 @@ @75 |r+0#af5f00255&|e|d|i|r| +0#0000000&|E+0#e000e06&|N|D| +0#0000000&@65 @75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|3|7|,|1| @9|B|o|t| +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|8|3|1|9| |(|r|e|d|i|r| |c|o|m@1|a|n|d| |n|o|t| |h|i|g|h|l|i|g|h|t|e|d| |i|n| |s|o|m|e| |c|a|s|e|s|)| +0#0000000&@14 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|V|i|m|9|C|o|n|t|e|x|t|(+0#e000e06&|)| +0#0000000&@57 +@57|3|7|,|1| @9|5|9|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_redir_03.dump b/runtime/syntax/testdir/dumps/vim_ex_redir_03.dump new file mode 100644 index 000000000..8e5d93392 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_redir_03.dump @@ -0,0 +1,20 @@ +|d+0#af5f00255#ffffff0|e|f| +0#0000000&|V|i|m|9|C|o|n|t|e|x|t|(+0#e000e06&|)| +0#0000000&@57 +@75 +|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@59 +|i+0#af5f00255&|f| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@67 +@4|r+0#af5f00255&|e|d|i|r| +0#0000000&|=+0#af5f00255&|>| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@58 +@4>s+0#af5f00255&|m|i|l|e| +0#0000000&@65 +@4|r+0#af5f00255&|e|d|i|r| +0#0000000&|E+0#e000e06&|N|D| +0#0000000&@61 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@66 +@75 +|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61 +@4|r+0#af5f00255&|e|d|i|r| +0#0000000&|=+0#af5f00255&|>| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@58 +@4|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|h|e|l@1|o| |f|r|o|m| |c|m|d|"| +0#0000000&@49 +@4|r+0#af5f00255&|e|d|i|r| +0#0000000&|E+0#e000e06&|N|D| +0#0000000&@61 +|}+0#e000e06&| +0#0000000&@73 +@75 +|r+0#af5f00255&|e|d|i|r| +0#0000000&|=+0#af5f00255&|>| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@62 +|e+0#af5f00255&|c|h|o|m| +0#0000000&|"+0#e000002&|h|e|l@1|o| |g|l|o|b|a|l|"| +0#0000000&@54 +|r+0#af5f00255&|e|d|i|r| +0#0000000&|E+0#e000e06&|N|D| +0#0000000&@65 +@57|5@1|,|5| @9|9|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_redir_04.dump b/runtime/syntax/testdir/dumps/vim_ex_redir_04.dump new file mode 100644 index 000000000..0a4027adc --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_redir_04.dump @@ -0,0 +1,20 @@ +|r+0#af5f00255#ffffff0|e|d|i|r| +0#0000000&|E+0#e000e06&|N|D| +0#0000000&@65 +@75 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +> @74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|7|1|,|0|-|1| @7|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_ex_redir.vim b/runtime/syntax/testdir/input/vim_ex_redir.vim index 1deb113fb..2b5319aa5 100644 --- a/runtime/syntax/testdir/input/vim_ex_redir.vim +++ b/runtime/syntax/testdir/input/vim_ex_redir.vim @@ -44,3 +44,28 @@ redir =>> var redir END + +" Issue #18319 (redir command not highlighted in some cases) + +def Vim9Context() + +var foo: string +if true + redir => foo + smile + redir END +endif +echo foo + +command Foo { + redir => foo + echo "hello from cmd" + redir END +} + +redir => foo +echom "hello global" +redir END + +enddef + diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index b8709d4fe..2ecb2b37a 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> " Doug Kearns <dougkea...@gmail.com> -" Last Change: 2025 Sep 08 +" Last Change: 2025 Sep 18 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -326,9 +326,9 @@ syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimV Vim9 syn match vimVar contained "\<\h\w*\ze<" nextgroup=vim9TypeArgs -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==" -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=" -Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==\%(\s\|$\)" +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=\%(\s\|$\)" +Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<\s" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uzKKV-00EkCR-Hx%40256bit.org.