aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-08 06:25:26 +0800
committerGitHub <noreply@github.com>2025-03-07 22:25:26 +0000
commit4a0e0e345340d715f784f317e99abfa71ecbc744 (patch)
treee47193841c55e3bccdafeb9f741c65d7cc7efb36
parent246b1e9fb39978d815d86a3810f712b72f8737aa (diff)
downloadrneovim-4a0e0e345340d715f784f317e99abfa71ecbc744.tar.gz
rneovim-4a0e0e345340d715f784f317e99abfa71ecbc744.tar.bz2
rneovim-4a0e0e345340d715f784f317e99abfa71ecbc744.zip
vim-patch:6bdfeb0: runtime(vim): Update base-syntax, bug fixes (#32775)
- 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: vim/vim#16822 https://github.com/vim/vim/commit/6bdfeb099a4d814f2686af427360da13578906eb Co-authored-by: Doug Kearns <dougkearns@gmail.com>
-rw-r--r--runtime/syntax/vim.vim24
1 files changed, 14 insertions, 10 deletions
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index de0a1228e2..7fe22190b7 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -711,9 +711,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
syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] 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
@@ -909,7 +911,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
@@ -1494,6 +1496,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