Skip to content

Commit 695522d

Browse files
dkearnschrisbra
authored andcommitted
runtime(vim): Update base-syntax, highlight literal string quote escape
Match the '' escape sequence in literal strings. These were previously ending the current string and starting another concatenated literal string. closes: #16415 Signed-off-by: Christian Brabandt <[email protected]> Signed-off-by: Doug Kearns <[email protected]>
1 parent 51754c8 commit 695522d

File tree

9 files changed

+104
-64
lines changed

9 files changed

+104
-64
lines changed

runtime/syntax/generator/vim.vim.base

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,19 +558,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\
558558
syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
559559
syn match vimNotPatSep contained "\\\\"
560560
syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
561-
syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend
562-
syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend
561+
syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend
562+
syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend
563563
"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
564564
syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
565565
syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
566+
566567
syn match vimEscape contained "\\."
567568
" syn match vimEscape contained +\\[befnrt\"]+
568569
syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
569570
syn match vimEscape contained "\\<" contains=vimNotation
570571
syn match vimEscape contained "\\<\*[^>]*>\=>"
572+
syn match vimQuoteEscape contained "''"
571573

572-
syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend
573-
syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend
574+
syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend
575+
syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend
574576
syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
575577
syn match vimStringInterpolationBrace contained "{{"
576578
syn match vimStringInterpolationBrace contained "}}"
@@ -1392,6 +1394,7 @@ if !exists("skip_vim_syntax_inits")
13921394
hi def link vimPattern Type
13931395
hi def link vimPlainMark vimMark
13941396
hi def link vimPlainRegister vimRegister
1397+
hi def link vimQuoteEscape vimEscape
13951398
hi def link vimRegister SpecialChar
13961399
hi def link vimScriptDelim Comment
13971400
hi def link vimSearchDelim Statement

runtime/syntax/testdir/dumps/vim_expr_00.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
>"+0#0000e05#ffffff0| |S|t|r|i|n|g| +0#0000000&@66
22
@75
3-
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'@1|s| |a| |s|t|r|i|n|g|'| +0#0000000&@53
3+
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'+0#e000e06&@1|s+0#e000002&| |a| |s|t|r|i|n|g|'| +0#0000000&@53
44
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|t|a|b|:| |\|t|,| |n|e|w| |l|i|n|e|:| |\|n|,| |b|a|c|k|s|l|a|s|h|:| |\@1|'| +0#0000000&@31
55
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|t|a|b|:| |\+0#e000e06&|t|,+0#e000002&| |n|e|w| |l|i|n|e|:| |\+0#e000e06&|n|,+0#e000002&| |b|a|c|k|s|l|a|s|h|:| |\+0#e000e06&@1|"+0#e000002&| +0#0000000&@31
66
@75

runtime/syntax/testdir/dumps/vim_expr_01.dump

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|C|-|>@1|>+0#e000002&|"| +0#0000000&@60
1313
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|*|C|-|>@1|>+0#e000002&|"| +0#0000000&@59
1414
@75
15-
|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52
15+
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@65
16+
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@62
17+
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@62
18+
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@59
1619
@75
17-
|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
18-
|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
19-
|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
20-
@57|1|5|,|1| @9|1|8|%|
20+
@57|1|5|,|1| @9|1|4|%|
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
|e+0#af5f00255#ffffff0|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
1+
| +0&#ffffff0@74
2+
|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |v|i|m|S|t|r|i|n|g| |v|i|m|M|a|r|k| |v|i|m|O|p|e|r| |N|O|N|E|)| +0#0000000&
3+
|"+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|t|p|o|p|e|/|v|i|m|-|u|n|i|m|p|a|i|r|e|d|/|b|l|o|b|/|6|d|4@1|a|6|d|c|2|e|c|3|4|6|0|7|c|4|1|e|c|7|8|a|c|f|8|1
4+
|6|5|7|2|4|8|5|8|0|b|f|1|/|p|l|u|g|i|n|/|u|n|i|m|p|a|i|r|e|d|.|v|i|m|#|L|2|3|2| +0#0000000&@35
5+
|l+0#af5f00255&|e|t| +0#0000000&|c+0#00e0e07&|m|d| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&|p|u|t|!|=|r|e|p|e|a|t|(|n|r|2|c|h|a|r|(|1|0|)|,| |v|:|c|o|u|n|t|1|)|||s|i|l|e|n|t| |'+0#e000e06&@1|]+0#e000002&|+|'| +0#0000000&@16
6+
> @74
7+
|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52
8+
@75
9+
|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'+0#e000e06&@1|t+0#e000002&| |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
10+
|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
11+
|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
212
|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
313
|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
414
|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
515
@75
6-
>"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66
7-
@75
8-
|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61
9-
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64
10-
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64
11-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64
12-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64
13-
@75
14-
|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65
15-
|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65
16-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65
17-
@75
18-
|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67
19-
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64
20-
@57|3@1|,|1| @9|4|6|%|
16+
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@64
17+
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@61
18+
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@61
19+
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58
20+
@57|3|2|,|0|-|1| @7|3|6|%|
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64
1+
|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58
2+
@75
3+
|"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66
4+
@75
5+
|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61
6+
>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64
7+
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64
8+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64
9+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64
10+
@75
11+
|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65
12+
|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65
13+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65
14+
@75
15+
|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67
16+
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64
217
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|o|3|7@1| +0#0000000&@63
318
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|O|3|7@1| +0#0000000&@63
419
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64
5-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63
6-
>e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63
7-
@75
8-
|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66
9-
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58
10-
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58
11-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58
12-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58
13-
@75
14-
|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67
15-
|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62
16-
|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62
17-
|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65
18-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63
19-
|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61
20-
@57|5|1|,|1| @9|7@1|%|
20+
@57|5|0|,|1| @9|6|1|%|
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61
2-
|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63
3-
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58
4-
@75
5-
|"+0#0000e05&| |B|l|o|b| +0#0000000&@68
6-
>e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67
7-
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55
8-
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53
9-
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50
1+
|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64
2+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63
3+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63
104
@75
5+
|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66
6+
>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58
7+
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58
8+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58
9+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58
1110
@75
12-
|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14
13-
|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46
11+
|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67
12+
|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62
13+
|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62
14+
|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65
15+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63
16+
|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61
17+
|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63
18+
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58
1419
@75
15-
|~+0#4040ff13&| @73
16-
|~| @73
17-
|~| @73
18-
|~| @73
19-
|~| @73
20-
| +0#0000000&@56|6|9|,|1| @9|B|o|t|
20+
@57|6|8|,|1| @9|8|6|%|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
| +0&#ffffff0@74
2+
|"+0#0000e05&| |B|l|o|b| +0#0000000&@68
3+
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67
4+
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55
5+
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53
6+
>e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50
7+
@75
8+
@75
9+
|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14
10+
|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46
11+
@75
12+
|~+0#4040ff13&| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
| +0#0000000&@56|8|6|,|1| @9|B|o|t|

runtime/syntax/testdir/input/vim_expr.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ echo "\<*C->>"
2121
echo "\<C->>>"
2222
echo "\<*C->>>"
2323

24+
echo ''''
25+
echo '''foo'
26+
echo 'foo'''
27+
echo 'foo''bar'
28+
29+
" Unreported issue (incorrectly matches as vimString vimMark vimOper NONE)
30+
" https://github.com/tpope/vim-unimpaired/blob/6d44a6dc2ec34607c41ec78acf81657248580bf1/plugin/unimpaired.vim#L232
31+
let cmd = 'put!=repeat(nr2char(10), v:count1)|silent '']+'
32+
2433
" String interpolation
2534

2635
echo 'Don''t highlight interpolation: {{ {1 + 2} }}'
@@ -30,6 +39,11 @@ echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}'
3039
echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}"
3140
echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}"
3241

42+
echo $''''
43+
echo $'''foo'
44+
echo $'foo'''
45+
echo $'foo''bar'
46+
3347
" Number
3448

3549
" Hexadecimal

runtime/syntax/vim.vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,19 +598,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\
598598
syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
599599
syn match vimNotPatSep contained "\\\\"
600600
syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
601-
syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend
602-
syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend
601+
syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend
602+
syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend
603603
"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
604604
syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
605605
syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
606+
606607
syn match vimEscape contained "\\."
607608
" syn match vimEscape contained +\\[befnrt\"]+
608609
syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
609610
syn match vimEscape contained "\\<" contains=vimNotation
610611
syn match vimEscape contained "\\<\*[^>]*>\=>"
612+
syn match vimQuoteEscape contained "''"
611613

612-
syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend
613-
syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend
614+
syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend
615+
syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend
614616
syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
615617
syn match vimStringInterpolationBrace contained "{{"
616618
syn match vimStringInterpolationBrace contained "}}"
@@ -1438,6 +1440,7 @@ if !exists("skip_vim_syntax_inits")
14381440
hi def link vimPattern Type
14391441
hi def link vimPlainMark vimMark
14401442
hi def link vimPlainRegister vimRegister
1443+
hi def link vimQuoteEscape vimEscape
14411444
hi def link vimRegister SpecialChar
14421445
hi def link vimScriptDelim Comment
14431446
hi def link vimSearchDelim Statement

0 commit comments

Comments
 (0)