]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Update base syntax, fix indented Vim9 :redir highlighting
authorDoug Kearns <dougkearns@gmail.com>
Thu, 18 Sep 2025 19:28:18 +0000 (19:28 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 18 Sep 2025 19:28:18 +0000 (19:28 +0000)
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>
runtime/syntax/generator/vim.vim.base
runtime/syntax/testdir/dumps/vim_ex_redir_01.dump
runtime/syntax/testdir/dumps/vim_ex_redir_02.dump
runtime/syntax/testdir/dumps/vim_ex_redir_03.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_redir_04.dump [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_redir.vim
runtime/syntax/vim.vim

index 2d89ce5ca79d1f588b58e1a5e599f3a08c2486e2..8230422f1ca56ad7108d57f9aea1550e71749e9a 100644 (file)
@@ -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
index 372c48430258a6c71030edc480db87d04fd29d53..64189fa9030ac2f74d4013633a9206ece4d91269 100644 (file)
@@ -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|%| 
index bff02dac0a809cbd1aca007c5f50302ea2146713..225197ea2f4e96bde2edf38e3e46bb34a61fa58d 100644 (file)
@@ -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 (file)
index 0000000..8e5d933
--- /dev/null
@@ -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 (file)
index 0000000..0a4027a
--- /dev/null
@@ -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| 
index 1deb113fb586e91f1132cbc00350c325c5fd5271..2b5319aa5799500561b6213d40433a0b4132efd6 100644 (file)
@@ -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
+
index b8709d4fefc8370cf37b6bac99d8643db44846b9..2ecb2b37af84ea8c4eeb556760e1a0c2adaf7acc 100644 (file)
@@ -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