Commit: runtime(vim): Update base-syntax, disallow '.' at start of menu item names (#14232)

2 views
Skip to first unread message

Christian Brabandt

unread,
Mar 19, 2024, 1:15:13 PM3/19/24
to vim...@googlegroups.com
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (#14232)

Commit: https://github.com/vim/vim/commit/ec21bafc135a1e78d40e4fc9118e022bbab958e8
Author: dkearns <dougk...@gmail.com>
Date: Wed Mar 20 04:04:42 2024 +1100

runtime(vim): Update base-syntax, disallow '.' at start of menu item names (https://github.com/vim/vim/issues/14232)

Disallow '.' at the start of a menu item name.

This is the menu path separator character and should be escaped with a
'\' in this case.

Partially fixes #14230. "popup" is still incorrectly matched as the Ex
command.

Signed-off-by: Doug Kearns <dougk...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base
index 6527be425..46285f3db 100644
--- a/runtime/syntax/generator/vim.vim.base
+++ b/runtime/syntax/generator/vim.vim.base
@@ -3,7 +3,7 @@
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougk...@gmail.com>
" URL: https://github.com/vim-jp/syntax-vim-ex
-" Last Change: 2024 Mar 18
+" Last Change: 2024 Mar 19
" Former Maintainer: Charles E. Campbell
" Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Base File Version: 9.0-25
@@ -498,8 +498,8 @@ syn case match
syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\|\|\|
\s*\\|
\s*"\ + end="$" matchgroup=vimSep end="|"
syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\|"\ \)+ skip=+\\\|\|\|
\s*\\|
\s*"\ + end="$" matchgroup=vimSep end="|"
-syn match vimMenuName "\%(\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
-syn match vimMenuName "\%(\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
+syn match vimMenuName "\.\@!\%(\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
+syn match vimMenuName "\.\@!\%(\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
syn match vimMenuNotation "& \|&&\|\\s\|\\." contained
syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
syn match vimMenuMod "
Reply all
Reply to author
Forward
0 new messages