# HG changeset patch # User Christian Brabandt # Date 1706981406 -3600 # Node ID 4de3dea72f1c4cf8c916e74b7f7dec3de0119198 # Parent 4609595adbc3b5fa45ae7257d221d4e8b50549d4 runtime(vim): Update syntax file (#13969) Commit: https://github.com/vim/vim/commit/7c5aeaffa2bec8f16f36bd33a749a6e965d8ab30 Author: dkearns Date: Sun Feb 4 04:18:31 2024 +1100 runtime(vim): Update syntax file (https://github.com/vim/vim/issues/13969) Improve string interpolation highlighting. Use the vimSep group to highlight interpolation braces as vimOperParen has no highlighting of its own and employs vimSep via matchgroup. Add vimNumber to the interpolation group's contained list. Signed-off-by: Doug Kearns Signed-off-by: thinca Signed-off-by: Christian Brabandt diff --git a/runtime/syntax/testdir/dumps/vim_expr_00.dump b/runtime/syntax/testdir/dumps/vim_expr_00.dump --- a/runtime/syntax/testdir/dumps/vim_expr_00.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_00.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|\|3|1|6| |\|3|1| |\|3| |\|x|1|f| |\|x|f| |\|X|1|F| |\|X|F| |\|u|0|2|a|4| |\|U|0@4|2|a|4| |\|b| |\|e| |\|f| |\|n| |\|r| |\|t| |\@1 | |\|"| |\|<|C|-|W|>|'| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|\+0#e000e06&|3|1|6|0+0#e000002&| |-| |\+0#e000e06&|x|1|f|0+0#e000002&| |-| |\+0#e000e06&|X|1|F|0+0#e000002&| |-| |\+0#e000e06&|u|0|2|a|4|0+0#e000002&| |-| |\+0#e000e06&|U|0@4|2|a|4|0+0#e000002&|"| +0#0000000&@21 -|"|i|n|p|u|t|/|v|i|m|_|e|x|p|r|.|v|i|m|"| |3|2|L|,| |1@1|6|3|B| @25|1|,|1| @10|T|o|p| +|"|i|n|p|u|t|/|v|i|m|_|e|x|p|r|.|v|i|m|"| |3|1|L|,| |1@1|6|2|B| @25|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_expr_01.dump b/runtime/syntax/testdir/dumps/vim_expr_01.dump --- a/runtime/syntax/testdir/dumps/vim_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_01.dump @@ -13,8 +13,8 @@ @75 |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'@1|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#0000000&| |s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#0000000&| |$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#0000000&|1| |++0#af5f00255&| +0#0000000&|2|}| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#0000000&| |s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#0000000&| |$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#0000000&|1| |++0#af5f00255&| +0#0000000&|2|}| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 -@57|1|9|,|1| @9|9|2|%| +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 +@57|1|9|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_expr_99.dump b/runtime/syntax/testdir/dumps/vim_expr_99.dump --- a/runtime/syntax/testdir/dumps/vim_expr_99.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_99.dump @@ -1,4 +1,6 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|"|\+0#e000e06&|3|1|6|0+0#e000002&| |-| |\+0#e000e06&|x|1|f|0+0#e000002&| |-| |\+0#e000e06&|X|1|F|0+0#e000002&| |-| |\+0#e000e06&|u|0|2|a|4|0+0#e000002&| |-| |\+0#e000e06&|U|0@4|2|a|4|0+0#e000002&|"| +0#0000000&@21 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|\|3|1|6| |\|3|1| |\|3| |\|x|1|f| |\|x|f| |\|X|1|F| |\|X|F| |\|u|0|2|a|4| |\|U|0@4|2|a|4| |\|b| |\|e| |\|f| |\|n| |\|r| |\|t| |\@1 +| |\|"| |\|<|C|-|W|>|'| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|\+0#e000e06&|3|1|6|0+0#e000002&| |-| |\+0#e000e06&|x|1|f|0+0#e000002&| |-| |\+0#e000e06&|X|1|F|0+0#e000002&| |-| |\+0#e000e06&|u|0|2|a|4|0+0#e000002&| |-| |\+0#e000e06&|U|0@4|2|a|4|0+0#e000002&|"| +0#0000000&@21 @75 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|C|-|a|>|"+0#e000002&| +0#0000000&@61 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|*|C|-|a|>|"+0#e000002&| +0#0000000&@60 @@ -11,10 +13,8 @@ @75 |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'@1|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#0000000&| |s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#0000000&| |$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#0000000&|1| |++0#af5f00255&| +0#0000000&|2|}| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#0000000&| |s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#0000000&| |$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#0000000&|1| |++0#af5f00255&| +0#0000000&|2|}| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 -> @74 -|~+0#4040ff13&| @73 -| +0#0000000&@56|3|2|,|0|-|1| @7|B|o|t| +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 +>e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 +@57|3|1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -29,4 +29,3 @@ echo $'Highlight interpolation:\t{{ { st echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" - diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -377,7 +377,7 @@ syn match vimEscape contained "\\<\*[^>] syn region vimString start=+$'+ end=+'+ skip=+''+ oneline contains=vimStringInterpolationBrace,vimStringInterpolationExpr syn region vimString start=+$"+ end=+"+ oneline contains=@vimStringGroup,vimStringInterpolationBrace,vimStringInterpolationExpr -syn region vimStringInterpolationExpr matchgroup=vimOperParen start=+{+ end=+}+ oneline contains=vimFunc,vimFuncVar,vimOper,vimNotation,vimOperParen,vimString,vimVar +syn region vimStringInterpolationExpr matchgroup=vimSep start=+{+ end=+}+ oneline contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNotation,vimNumber,vimString,vimVar syn match vimStringInterpolationBrace "{{" syn match vimStringInterpolationBrace "}}"