Merge pull request #29292 from zeertzjq/vim-059cbe893355

vim-patch:059cbe8,959c3c8
This commit is contained in:
zeertzjq 2024-06-12 11:06:57 +08:00 committed by GitHub
commit af8001d100
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 15 deletions

View File

@ -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. > embedded script highlighting they wish to have. >
g:vimsyn_embed == 0 : disable (don't embed any scripts) 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. This option is disabled by default.
*g:vimsyn_folding* *g:vimsyn_folding*
Some folding is now supported with when 'foldmethod' is set to "syntax": > 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 == 0 or doesn't exist: no syntax-based folding
g:vimsyn_folding =~ 'a' : augroups g:vimsyn_folding =~ 'a' : augroups
g:vimsyn_folding =~ 'f' : fold functions g:vimsyn_folding =~ 'f' : fold functions
g:vimsyn_folding =~ 'h' : fold heredocs g:vimsyn_folding =~ 'h' : fold heredocs
g:vimsyn_folding =~ 'l' : fold lua script g:vimsyn_folding =~ 'l' : fold Lua script
g:vimsyn_folding =~ 'p' : fold perl script g:vimsyn_folding =~ 'p' : fold Perl script
g:vimsyn_folding =~ 'P' : fold python script g:vimsyn_folding =~ 'P' : fold Python script
g:vimsyn_folding =~ 'r' : fold ruby script g:vimsyn_folding =~ 'r' : fold Ruby script
< <
By default, g:vimsyn_folding is unset. Concatenate the indicated characters By default, g:vimsyn_folding is unset. Concatenate the indicated characters
to support folding of multiple syntax constructs; i.e. to support folding of multiple syntax constructs (e.g.,
g:vimsyn_folding = "fh" will enable folding of both functions and heredocs. g:vimsyn_folding = "fh" will enable folding of both functions and heredocs).
*g:vimsyn_noerror* *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*
Not all error highlighting that syntax/vim.vim does may be correct; Vim script 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 is a difficult language to highlight correctly. A way to suppress error
highlighting is to put the following line in your |vimrc|: > highlighting is to put the following line in your |vimrc|: >

View File

@ -359,7 +359,9 @@ syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contain
" Lower Priority Comments: after some vim commands... {{{2 " 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 if s:vim9script
syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained
@ -806,16 +808,17 @@ syn match vimCtrlChar "[- -]"
" Beginners - Patterns that involve ^ {{{2 " Beginners - Patterns that involve ^ {{{2
" ========= " =========
if s:vim9script if s:vim9script
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained
else else
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle
syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained
endif endif
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup
syn match vimContinue "^\s*\zs\\" syn match vimContinue "^\s*\zs\\"
syn match vimContinueComment '^\s*\zs["#]\\ .*' contained syn match vimContinueComment '^\s*\zs["#]\\ .*'
syn cluster vimContinue contains=vimContinue,vimContinueComment syn cluster vimContinue contains=vimContinue,vimContinueComment
syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained