From 1240d29f8fcf390bcd2cb2fd6e916c629364009a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 2 Aug 2025 19:35:21 +0800 Subject: [PATCH] vim-patch:b88f9e4: runtime(vim): Update base syntax, fix :map termination in :command RHS (#35131) Ensure :map (and :abbreviate) terminate at | when included in :command replacement strings containing commands separated by line continuations. https://github.com/vim/vim/commit/b88f9e4a04ce9fb70abb7cdae17688aa4f49c8c9 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 244554bdb7..faa594cacf 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1365,9 +1365,20 @@ syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation, 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<\%(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,vimMapLeader +syn region vimMapRhs contained + \ start="\S" + \ skip=+\\|\|\@1<=|\|\n\s*\%(\\\|["#]\\ \)+ + \ end="\ze|" + \ end="$" + \ nextgroup=vimCmdSep + \ contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader +syn region vimMapRhsContinue contained + \ start=+^\s*\%(\\\|["#]\\ \)+ + \ skip=+\\|\|\@1<=|\|\n\s*\%(\\\|["#]\\ \)+ + \ end="\ze|" + \ end="$" + \ nextgroup=vimCmdSep + \ 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