aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-12 10:23:09 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-06-12 10:29:19 +0800
commitbbe69b4022b577a801653991a8b7f7f2ab869e97 (patch)
tree35c3a5b74d18b2001fb572e1938064a76af96430
parentc7799b1a23f82128e793448165ae88b403f9ef17 (diff)
downloadrneovim-bbe69b4022b577a801653991a8b7f7f2ab869e97.tar.gz
rneovim-bbe69b4022b577a801653991a8b7f7f2ab869e97.tar.bz2
rneovim-bbe69b4022b577a801653991a8b7f7f2ab869e97.zip
vim-patch:959c3c8: runtime(vim): Update base-syntax, configurable comment string highlighting (vim/vim#14931)
Allow highlighting of strings within comments to be disabled by setting g:vimsyn_comment_strings to false. https://github.com/vim/vim/commit/959c3c887b2e52c7141b2a09a53634481911b1b7 Co-authored-by: dkearns <dougkearns@gmail.com>
-rw-r--r--runtime/doc/syntax.txt21
-rw-r--r--runtime/syntax/vim.vim4
2 files changed, 15 insertions, 10 deletions
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 61028c791d..ded5e46d07 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -3327,28 +3327,31 @@ 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 : disable (don't embed any scripts)
- g:vimsyn_embed == 'lpPr' : support embedded lua, perl, python and ruby
+ g:vimsyn_embed == 'lpPr' : support embedded Lua, Perl, Python and Ruby
<
This option is disabled by default.
*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
g:vimsyn_folding =~ 'a' : augroups
g:vimsyn_folding =~ 'f' : fold functions
g:vimsyn_folding =~ 'h' : fold heredocs
- g:vimsyn_folding =~ 'l' : fold lua 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 =~ 'l' : fold Lua script
+ g:vimsyn_folding =~ 'p' : fold Perl script
+ g:vimsyn_folding =~ 'P' : fold Python script
+ g:vimsyn_folding =~ 'r' : fold Ruby 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|: >
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index d916a666c9..d16d62dc4a 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -359,7 +359,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