]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Update base-syntax, configurable comment string highlighting (#14931)
authordkearns <dougkearns@gmail.com>
Tue, 11 Jun 2024 18:18:08 +0000 (04:18 +1000)
committerGitHub <noreply@github.com>
Tue, 11 Jun 2024 18:18:08 +0000 (20:18 +0200)
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
18 files changed:
runtime/doc/syntax.txt
runtime/doc/tags
runtime/syntax/generator/vim.vim.base
runtime/syntax/testdir/dumps/vim9_ex_comment_strings_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_ex_comment_strings_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_ex_comment_strings_99.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_99.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_comment_strings_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_comment_strings_99.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_99.dump [new file with mode: 0644]
runtime/syntax/testdir/input/vim9_ex_comment_strings.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_comment_strings.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim [new file with mode: 0644]
runtime/syntax/vim.vim

index d09a6c6ee00245e7e5ab9021a9442ee5e914e180..eb1dd785661cca47bf6a3401117cb7ba4ff80b9e 100644 (file)
@@ -3802,19 +3802,18 @@ The g:vimsyn_embed option allows users to select what, if any, types of
 embedded script highlighting they wish to have. >
 
    g:vimsyn_embed == 0   : don't support any embedded scripts
-   g:vimsyn_embed =~ 'l' : support embedded lua
-   g:vimsyn_embed =~ 'm' : support embedded mzscheme
-   g:vimsyn_embed =~ 'p' : support embedded perl
-   g:vimsyn_embed =~ 'P' : support embedded python
-   g:vimsyn_embed =~ 'r' : support embedded ruby
-   g:vimsyn_embed =~ 't' : support embedded tcl
+   g:vimsyn_embed =~ 'l' : support embedded Lua
+   g:vimsyn_embed =~ 'm' : support embedded MzScheme
+   g:vimsyn_embed =~ 'p' : support embedded Perl
+   g:vimsyn_embed =~ 'P' : support embedded Python
+   g:vimsyn_embed =~ 'r' : support embedded Ruby
+   g:vimsyn_embed =~ 't' : support embedded Tcl
 <
 By default, g:vimsyn_embed is a string supporting interpreters that your vim
 itself supports.  Concatenate the indicated characters to support multiple
-types of embedded interpreters; ie. g:vimsyn_embed = "mp" supports embedded
-mzscheme and embedded perl.
+types of embedded interpreters (e.g., g:vimsyn_embed = "mp" supports embedded
+mzscheme and embedded perl).
                                                *g:vimsyn_folding*
-
 Some folding is now supported with when 'foldmethod' is set to "syntax": >
 
    g:vimsyn_folding == 0 or doesn't exist: no syntax-based folding
@@ -3822,19 +3821,23 @@ Some folding is now supported with when 'foldmethod' is set to "syntax": >
    g:vimsyn_folding =~ 'f' : fold functions
    g:vimsyn_folding =~ 'h' : fold heredocs
    g:vimsyn_folding =~ 'H' : fold Vim9-script legacy headers
-   g:vimsyn_folding =~ 'l' : fold lua      script
-   g:vimsyn_folding =~ 'm' : fold mzscheme script
-   g:vimsyn_folding =~ 'p' : fold perl     script
-   g:vimsyn_folding =~ 'P' : fold python   script
-   g:vimsyn_folding =~ 'r' : fold ruby     script
-   g:vimsyn_folding =~ 't' : fold tcl      script
+   g:vimsyn_folding =~ 'l' : fold Lua      script
+   g:vimsyn_folding =~ 'm' : fold MzScheme script
+   g:vimsyn_folding =~ 'p' : fold Perl     script
+   g:vimsyn_folding =~ 'P' : fold Python   script
+   g:vimsyn_folding =~ 'r' : fold Ruby     script
+   g:vimsyn_folding =~ 't' : fold Tcl      script
 <
 
 By default, g:vimsyn_folding is unset.  Concatenate the indicated characters
-to support folding of multiple syntax constructs; i.e.
-g:vimsyn_folding = "fh" will enable folding of both functions and heredocs.
+to support folding of multiple syntax constructs (e.g.,
+g:vimsyn_folding = "fh" will enable folding of both functions and heredocs).
+
+                                               *g:vimsyn_comment_strings*
+By default, strings are highlighted inside comments.  This may be disabled by
+setting g:vimsyn_comment_strings to false.
 
-                                                       *g:vimsyn_noerror*
+                                               *g:vimsyn_noerror*
 Not all error highlighting that syntax/vim.vim does may be correct; Vim script
 is a difficult language to highlight correctly.  A way to suppress error
 highlighting is to put the following line in your |vimrc|: >
index 3085ccc4ca375b0c8073d034f27e97255164e94f..56669d83b1bb5eabdea0d8054ee5ff3d9ddc28cd 100644 (file)
@@ -7709,6 +7709,7 @@ g:vim_indent      indent.txt      /*g:vim_indent*
 g:vim_indent_cont      indent.txt      /*g:vim_indent_cont*
 g:vimball_home pi_vimball.txt  /*g:vimball_home*
 g:vimball_mkdir        pi_vimball.txt  /*g:vimball_mkdir*
+g:vimsyn_comment_strings       syntax.txt      /*g:vimsyn_comment_strings*
 g:vimsyn_embed syntax.txt      /*g:vimsyn_embed*
 g:vimsyn_folding       syntax.txt      /*g:vimsyn_folding*
 g:vimsyn_maxlines      syntax.txt      /*g:vimsyn_maxlines*
index 42c93dc5bf04423a6e60f6b78bf7ca02a84fde7c..bd597e9d541bc4d5785ee256dadb56c8d93bb1d7 100644 (file)
@@ -369,7 +369,9 @@ syn region  vimUserCmdBlock contained       matchgroup=vimSep start="{" end="}" contain
 
 " Lower Priority Comments: after some vim commands... {{{2
 " =======================
-syn region     vimCommentString        contained oneline start='\S\s\+"'ms=e end='"'
+if get(g:, "vimsyn_comment_strings", 1)
+  syn region   vimCommentString        contained oneline start='\S\s\+"'ms=e end='"'
+endif
 
 if s:vim9script
   syn match    vimComment      excludenl +\s"[^\-:.%#=*].*$+lc=1       contains=@vimCommentGroup,vimCommentString contained
diff --git a/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_00.dump b/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_00.dump
new file mode 100644 (file)
index 0000000..0236684
--- /dev/null
@@ -0,0 +1,20 @@
+>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
+@75
+|#+0#0000e05&| |V|i|m| |c|o|m@1|e|n|t| |s|t|r|i|n|g|s| +0#0000000&@53
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|t|r|u|e| +0#0000000&@20
+@75
+|#+0#0000e05&| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_01.dump b/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_01.dump
new file mode 100644 (file)
index 0000000..1fd26e6
--- /dev/null
@@ -0,0 +1,20 @@
+|e+0#af5f00255#ffffff0|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+> @74
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9|,|0|-|1| @7|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_99.dump b/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_99.dump
new file mode 100644 (file)
index 0000000..1f495da
--- /dev/null
@@ -0,0 +1,20 @@
+|#+0#0000e05#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|t|r|u|e| +0#0000000&@20
+@75
+|#+0#0000e05&| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+>}+0#e000e06&| +0#0000000&@73
+@57|2@1|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_00.dump b/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_00.dump
new file mode 100644 (file)
index 0000000..cc6ffe5
--- /dev/null
@@ -0,0 +1,20 @@
+>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
+@75
+|#+0#0000e05&| |V|i|m| |c|o|m@1|e|n|t| |s|t|r|i|n|g|s| +0#0000000&@53
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|f|a|l|s|e| +0#0000000&@19
+@75
+|#+0#0000e05&| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_01.dump b/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_01.dump
new file mode 100644 (file)
index 0000000..bde4dbc
--- /dev/null
@@ -0,0 +1,20 @@
+|e+0#af5f00255#ffffff0|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+> @74
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9|,|0|-|1| @7|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_99.dump b/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_99.dump
new file mode 100644 (file)
index 0000000..8445c5b
--- /dev/null
@@ -0,0 +1,20 @@
+|#+0#0000e05#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|f|a|l|s|e| +0#0000000&@19
+@75
+|#+0#0000e05&| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+>}+0#e000e06&| +0#0000000&@73
+@57|2@1|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment_strings_00.dump b/runtime/syntax/testdir/dumps/vim_ex_comment_strings_00.dump
new file mode 100644 (file)
index 0000000..6aef5b6
--- /dev/null
@@ -0,0 +1,20 @@
+>"+0#0000e05#ffffff0| |V|i|m| |c|o|m@1|e|n|t| |s|t|r|i|n|g|s| +0#0000000&@53
+|"+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|t|r|u|e| +0#0000000&@20
+@75
+|"+0#0000e05&| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_comment_strings_99.dump b/runtime/syntax/testdir/dumps/vim_ex_comment_strings_99.dump
new file mode 100644 (file)
index 0000000..13671f6
--- /dev/null
@@ -0,0 +1,20 @@
+|"+0#0000e05#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|t|r|u|e| +0#0000000&@20
+@75
+|"+0#0000e05&| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"+0#e000002&|s|t|r|i|n|g|"| +0#0000e05&|p|o|s|t| +0#0000000&@53
+>}+0#e000e06&| +0#0000000&@73
+@57|2|0|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_00.dump b/runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_00.dump
new file mode 100644 (file)
index 0000000..fc55c39
--- /dev/null
@@ -0,0 +1,20 @@
+>"+0#0000e05#ffffff0| |V|i|m| |c|o|m@1|e|n|t| |s|t|r|i|n|g|s| +0#0000000&@53
+|"+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|f|a|l|s|e| +0#0000000&@19
+@75
+|"+0#0000e05&| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_99.dump b/runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_99.dump
new file mode 100644 (file)
index 0000000..7bff27b
--- /dev/null
@@ -0,0 +1,20 @@
+|"+0#0000e05#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s| |=| |v|:|f|a|l|s|e| +0#0000000&@19
+@75
+|"+0#0000e05&| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@55
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+| +0#0000e05&@1|"| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)| +0#0000000&@65
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@61
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+|}+0#e000e06&| +0#0000000&@73
+@75
+|a+0#af5f00255&|u|t|o|c|m|d| +0#0000000&|B+0#00e0003&|u|f|N|e|w|F|i|l|e| +0#0000000&|*| |{+0#e000e06&| +0#0000000&@52
+| +0#0000e05&@1|#| |p|r|e| |"|s|t|r|i|n|g|"| |p|o|s|t| +0#0000000&@53
+>}+0#e000e06&| +0#0000000&@73
+@57|2|0|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/input/vim9_ex_comment_strings.vim b/runtime/syntax/testdir/input/vim9_ex_comment_strings.vim
new file mode 100644 (file)
index 0000000..fd02c1a
--- /dev/null
@@ -0,0 +1,22 @@
+vim9script
+
+# Vim comment strings
+# VIM_TEST_SETUP let g:vimsyn_comment_strings = v:true
+
+# pre "string" post
+
+function Foo()
+  " pre "string" post
+endfunction
+
+def Bar()
+  # pre "string" post
+enddef
+
+command Foo {
+  # pre "string" post
+}
+
+autocmd BufNewFile * {
+  # pre "string" post
+}
diff --git a/runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim b/runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim
new file mode 100644 (file)
index 0000000..dcea14d
--- /dev/null
@@ -0,0 +1,22 @@
+vim9script
+
+# Vim comment strings
+# VIM_TEST_SETUP let g:vimsyn_comment_strings = v:false
+
+# pre "string" post
+
+function Foo()
+  " pre "string" post
+endfunction
+
+def Bar()
+  # pre "string" post
+enddef
+
+command Foo {
+  # pre "string" post
+}
+
+autocmd BufNewFile * {
+  # pre "string" post
+}
diff --git a/runtime/syntax/testdir/input/vim_ex_comment_strings.vim b/runtime/syntax/testdir/input/vim_ex_comment_strings.vim
new file mode 100644 (file)
index 0000000..4214d6b
--- /dev/null
@@ -0,0 +1,20 @@
+" Vim comment strings
+" VIM_TEST_SETUP let g:vimsyn_comment_strings = v:true
+
+" pre "string" post
+
+function Foo()
+  " pre "string" post
+endfunction
+
+def Bar()
+  # pre "string" post
+enddef
+
+command Foo {
+  # pre "string" post
+}
+
+autocmd BufNewFile * {
+  # pre "string" post
+}
diff --git a/runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim b/runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim
new file mode 100644 (file)
index 0000000..d9b53b3
--- /dev/null
@@ -0,0 +1,20 @@
+" Vim comment strings
+" VIM_TEST_SETUP let g:vimsyn_comment_strings = v:false
+
+" pre "string" post
+
+function Foo()
+  " pre "string" post
+endfunction
+
+def Bar()
+  # pre "string" post
+enddef
+
+command Foo {
+  # pre "string" post
+}
+
+autocmd BufNewFile * {
+  # pre "string" post
+}
index 5ad4d00e3d49e3bedaed1c0d7a822229ad5dfc0b..720866146c021a59a0057e8d9f7acd58a922e5ee 100644 (file)
@@ -408,7 +408,9 @@ syn region  vimUserCmdBlock contained       matchgroup=vimSep start="{" end="}" contain
 
 " Lower Priority Comments: after some vim commands... {{{2
 " =======================
-syn region     vimCommentString        contained oneline start='\S\s\+"'ms=e end='"'
+if get(g:, "vimsyn_comment_strings", 1)
+  syn region   vimCommentString        contained oneline start='\S\s\+"'ms=e end='"'
+endif
 
 if s:vim9script
   syn match    vimComment      excludenl +\s"[^\-:.%#=*].*$+lc=1       contains=@vimCommentGroup,vimCommentString contained