mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
runtime(vim): Update base-syntax, improve :set backslash handling
Improve backslash handling in :set option values. There is no special handling for options supporting Windows path separators yet. See :help option-backslash. Remove the vimSetString syntax group. Option string values cannot be specified with a quoted string, this is a command terminating tail comment. fixes: #16913 closes: #17034 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
d211558044
commit
2a6be83512
@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2025 Mar 29
|
||||
" Last Change: 2025 Apr 03
|
||||
" Former Maintainer: Charles E. Campbell
|
||||
|
||||
" DO NOT CHANGE DIRECTLY.
|
||||
@ -823,12 +823,31 @@ syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
|
||||
|
||||
" Set command and associated set-options (vimOptions) with comment {{{2
|
||||
syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetArgs
|
||||
syn region vimSetArgs contained start="\S" skip=+\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
|
||||
syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
|
||||
syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend
|
||||
syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
|
||||
syn match vimSetEscape contained "\\\%(\\[|"]\|.\)"
|
||||
syn match vimSetBarEscape contained "\\|"
|
||||
syn match vimSetQuoteEscape contained +\\"+
|
||||
syn region vimSetArgs contained
|
||||
\ start="\S"
|
||||
\ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ +
|
||||
\ end=+\ze\\\@1<![|"]+
|
||||
"\ assume this isn't an escaped char with backslash on the previous line
|
||||
\ end=+^\s*\\\ze[|"]+
|
||||
\ end="\ze\s#"
|
||||
\ end="$"
|
||||
\ nextgroup=vimSetCmdSep,vimSetComment,vim9Comment
|
||||
\ contains=@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
|
||||
\ keepend
|
||||
syn region vimSetEqual contained
|
||||
\ matchgroup=vimOper
|
||||
\ start="[=:]\|[-+^]="
|
||||
\ skip=+\\\s\|^\s*\%(\\\|["#]\\ \)+
|
||||
\ end="\ze\s"
|
||||
\ contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep,vimSetEscape,vimSetBarEscape,vimSetQuoteEscape
|
||||
syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
|
||||
syn keyword vimSetAll contained all nextgroup=vimSetMod
|
||||
syn keyword vimSetTermcap contained termcap
|
||||
syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
|
||||
syn match vimSetSep contained "[,:]"
|
||||
syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)"
|
||||
|
||||
@ -1682,9 +1701,9 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vimSet vimCommand
|
||||
hi def link vimSetAll vimOption
|
||||
hi def link vimSetBang vimBang
|
||||
hi def link vimSetComment vimComment
|
||||
hi def link vimSetMod vimOption
|
||||
hi def link vimSetSep vimSep
|
||||
hi def link vimSetString vimString
|
||||
hi def link vimSetTermcap vimOption
|
||||
hi def link vimShebang PreProc
|
||||
hi def link vimSleep vimCommand
|
||||
|
Reference in New Issue
Block a user