runtime(vim): Update base-syntax, bug fixes
- Allow trailing backslashes in option values. - Match :map-special modifier. - Match :map-arguments case-sensitively. - Remove <*Leader> from map modifier list and allow in RHS of a mapping. closes: #16822 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
4a1e6dacbb
commit
6bdfeb099a
@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2025 Feb 27
|
||||
" Last Change: 2025 Mar 06
|
||||
" Former Maintainer: Charles E. Campbell
|
||||
|
||||
" DO NOT CHANGE DIRECTLY.
|
||||
@ -716,9 +716,9 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
|
||||
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,vimSetRegion
|
||||
syn region vimSetRegion 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 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 match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
|
||||
syn keyword vimSetAll contained all nextgroup=vimSetMod
|
||||
syn keyword vimSetTermcap contained termcap
|
||||
@ -835,15 +835,17 @@ syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
|
||||
" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
|
||||
syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
|
||||
|
||||
syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs
|
||||
syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue
|
||||
syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite nextgroup=vimMapRhs
|
||||
syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite skipnl nextgroup=vimMapRhsContinue
|
||||
syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue
|
||||
syn match vimMapMod contained "\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader skipnl nextgroup=vimMapRhsContinue
|
||||
" assume a continuation comment introduces the RHS
|
||||
syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation
|
||||
syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader
|
||||
syn match vimMapLeader contained "\%#=1\c<\%(local\)\=leader>" contains=vimMapLeaderKey
|
||||
syn keyword vimMapModKey contained buffer expr nowait script silent special unique
|
||||
syn case ignore
|
||||
syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
|
||||
syn keyword vimMapLeaderKey contained leader localleader
|
||||
syn case match
|
||||
|
||||
" Menus: {{{2
|
||||
@ -908,7 +910,7 @@ syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@
|
||||
" Vim user commands
|
||||
|
||||
" Compiler plugins
|
||||
syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetRegion
|
||||
syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetArgs
|
||||
|
||||
" runtime/makemenu.vim
|
||||
syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
|
||||
@ -1487,6 +1489,8 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vimLetRegister Special
|
||||
hi def link vimLineComment vimComment
|
||||
hi def link vimMapBang vimBang
|
||||
hi def link vimMapLeader vimBracket
|
||||
hi def link vimMapLeaderKey vimNotation
|
||||
hi def link vimMapModKey vimFuncSID
|
||||
hi def link vimMapMod vimBracket
|
||||
hi def link vimMap vimCommand
|
||||
|
||||
Reference in New Issue
Block a user