summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
diff options
context:
space:
mode:
authordkearns <dougkearns@gmail.com>2024-06-12 04:18:08 +1000
committerGitHub <noreply@github.com>2024-06-11 20:18:08 +0200
commit959c3c887b2e52c7141b2a09a53634481911b1b7 (patch)
tree86fcec862f89b0aaf51d790d6716f74fbced81ba /runtime/syntax
parentb4e648a0066940e0e8b513ff2e7347b5a3473694 (diff)
runtime(vim): Update base-syntax, configurable comment string highlighting (#14931)
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>
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/generator/vim.vim.base4
-rw-r--r--runtime/syntax/testdir/dumps/vim9_ex_comment_strings_00.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim9_ex_comment_strings_01.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim9_ex_comment_strings_99.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_00.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_01.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_99.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim_ex_comment_strings_00.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim_ex_comment_strings_99.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_00.dump20
-rw-r--r--runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_99.dump20
-rw-r--r--runtime/syntax/testdir/input/vim9_ex_comment_strings.vim22
-rw-r--r--runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim22
-rw-r--r--runtime/syntax/testdir/input/vim_ex_comment_strings.vim20
-rw-r--r--runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim20
-rw-r--r--runtime/syntax/vim.vim4
16 files changed, 290 insertions, 2 deletions
diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base
index 42c93dc5bf..bd597e9d54 100644
--- a/runtime/syntax/generator/vim.vim.base
+++ b/runtime/syntax/generator/vim.vim.base
@@ -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
index 0000000000..0236684d21
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_00.dump
@@ -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
index 0000000000..1fd26e65e2
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_01.dump
@@ -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
index 0000000000..1f495da4d2
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim9_ex_comment_strings_99.dump
@@ -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
index 0000000000..cc6ffe50de
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_00.dump
@@ -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
index 0000000000..bde4dbc5cb
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_01.dump
@@ -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
index 0000000000..8445c5b9cc
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim9_ex_no_comment_strings_99.dump
@@ -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
index 0000000000..6aef5b63de
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_ex_comment_strings_00.dump
@@ -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
index 0000000000..13671f65a2
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_ex_comment_strings_99.dump
@@ -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
index 0000000000..fc55c39fcd
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_00.dump
@@ -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
index 0000000000..7bff27bbb6
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_ex_no_comment_strings_99.dump
@@ -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
index 0000000000..fd02c1a60a
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim9_ex_comment_strings.vim
@@ -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
index 0000000000..dcea14d28d
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim9_ex_no_comment_strings.vim
@@ -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
index 0000000000..4214d6b3a0
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim_ex_comment_strings.vim
@@ -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
index 0000000000..d9b53b3a30
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim_ex_no_comment_strings.vim
@@ -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
+}
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 5ad4d00e3d..720866146c 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -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