From 0d469b697ed48a1cb1b624d65b6cd22a47195707 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 9 Jan 2025 08:40:50 +0800 Subject: vim-patch:1718e7d: runtime(vim): Update base-syntax, improve ex-bang matching (#31922) Always match ex-bang explicitly rather than incidentally as the ! operator. fixes: vim/vim#16221 closes: vim/vim#16410 https://github.com/vim/vim/commit/1718e7d07e391571ac81c507a746b3bc7a7e2024 Co-authored-by: Doug Kearns --- src/nvim/generators/gen_vimvim.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/generators/gen_vimvim.lua b/src/nvim/generators/gen_vimvim.lua index 0675f04b73..d8053822bf 100644 --- a/src/nvim/generators/gen_vimvim.lua +++ b/src/nvim/generators/gen_vimvim.lua @@ -52,11 +52,13 @@ local function is_special_cased_cmd(cmd) end local vimcmd_start = 'syn keyword vimCommand contained ' +local vimcmd_end = ' nextgroup=vimBang' w(vimcmd_start) + local prev_cmd = nil for _, cmd_desc in ipairs(ex_cmds.cmds) do if lld.line_length > 850 then - w('\n' .. vimcmd_start) + w(vimcmd_end .. '\n' .. vimcmd_start) end local cmd = cmd_desc.command if cmd:match('%w') and cmd ~= 'z' and not is_special_cased_cmd(cmd) then @@ -79,9 +81,11 @@ for _, cmd_desc in ipairs(ex_cmds.cmds) do prev_cmd = cmd end +w(vimcmd_end .. '\n') + local vimopt_start = 'syn keyword vimOption contained ' local vimopt_end = ' skipwhite nextgroup=vimSetEqual,vimSetMod' -w('\n\n' .. vimopt_start) +w('\n' .. vimopt_start) for _, opt_desc in ipairs(options.options) do if not opt_desc.immutable then -- cgit