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 <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
5bf41e7418
commit
57d243e27d
@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@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
|
||||
|
@ -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|%|
|
||||
|
@ -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|%|
|
||||
|
20
runtime/syntax/testdir/dumps/vim_ex_redir_03.dump
Normal file
20
runtime/syntax/testdir/dumps/vim_ex_redir_03.dump
Normal file
@ -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|%|
|
20
runtime/syntax/testdir/dumps/vim_ex_redir_04.dump
Normal file
20
runtime/syntax/testdir/dumps/vim_ex_redir_04.dump
Normal file
@ -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|
|
@ -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
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@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
|
||||
|
Reference in New Issue
Block a user