commit 92883b918cc50e91669f4fc6fe4d48c18d795523
parent 40c61bf20570c0cd9e705e7b9d7545171db5624b
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 24 Jun 2025 07:17:43 +0800
vim-patch:a931371: runtime(vim): Update base-syntax, match OR operator in :echo and :execute (#34623)
Don't match the OR operator in expressions as a trailing bar.
closes: vim/vim#17533
https://github.com/vim/vim/commit/a9313716942dca456943f2df1bd4e8ecd32f85e5
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat:
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
@@ -1213,8 +1213,12 @@ syn region vimEcho
\ start="\<echoc\%[onsole]\>"
\ start="\<echon\>"
\ start="\<echow\%[indow]\>"
- \ skip=+\\|\|\n\s*\\\|\n\s*"\\ +
- \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
+ \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
+ \ end="\ze|"
+ \ excludenl end="$"
+ \ nextgroup=vimCmdSep
+ \ contains=@vimContinue,@vimExprList
+ \ transparent
syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone,vimOnlyHLGroup,nvimHLGroup
syn case ignore
@@ -1223,7 +1227,15 @@ syn case match
syn cluster vimEcho contains=vimEcho,vimEchohl
-syn region vimExecute matchgroup=vimCommand start="\<exe\%[cute]\>" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
+syn region vimExecute
+ \ matchgroup=vimCommand
+ \ start="\<exe\%[cute]\>"
+ \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
+ \ end="\ze|"
+ \ excludenl end="$"
+ \ nextgroup=vimCmdSep
+ \ contains=@vimContinue,@vimExprList
+ \ transparent
" Filter: {{{2
" ======