mirror of
https://github.com/neovim/neovim
synced 2025-07-16 17:21:49 +00:00
Merge pull request #18534 from neovim/backport-18480-to-release-0.7
[Backport release-0.7] fix(runtime/genvimvim): omit s[ubstitute] from vimCommand
This commit is contained in:
@ -120,9 +120,6 @@ else
|
|||||||
com! -nargs=* VimFoldt <args>
|
com! -nargs=* VimFoldt <args>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" commands not picked up by the generator (due to non-standard format) {{{2
|
|
||||||
syn keyword vimCommand contained py3
|
|
||||||
|
|
||||||
" Deprecated variable options {{{2
|
" Deprecated variable options {{{2
|
||||||
if exists("g:vim_minlines")
|
if exists("g:vim_minlines")
|
||||||
let g:vimsyn_minlines= g:vim_minlines
|
let g:vimsyn_minlines= g:vim_minlines
|
||||||
|
@ -44,12 +44,13 @@ local function cmd_kw(prev_cmd, cmd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Exclude these from the vimCommand keyword list, they are handled specially
|
-- Exclude these from the vimCommand keyword list, they are handled specially
|
||||||
-- in syntax/vim.vim (vimAugroupKey, vimAutoCmd). #9327
|
-- in syntax/vim.vim (vimAugroupKey, vimAutoCmd, vimSubst). #9327
|
||||||
local function is_autocmd_cmd(cmd)
|
local function is_special_cased_cmd(cmd)
|
||||||
return (cmd == 'augroup'
|
return (cmd == 'augroup'
|
||||||
or cmd == 'autocmd'
|
or cmd == 'autocmd'
|
||||||
or cmd == 'doautocmd'
|
or cmd == 'doautocmd'
|
||||||
or cmd == 'doautoall')
|
or cmd == 'doautoall'
|
||||||
|
or cmd == 'substitute')
|
||||||
end
|
end
|
||||||
|
|
||||||
local vimcmd_start = 'syn keyword vimCommand contained '
|
local vimcmd_start = 'syn keyword vimCommand contained '
|
||||||
@ -60,7 +61,7 @@ for _, cmd_desc in ipairs(ex_cmds.cmds) do
|
|||||||
w('\n' .. vimcmd_start)
|
w('\n' .. vimcmd_start)
|
||||||
end
|
end
|
||||||
local cmd = cmd_desc.command
|
local cmd = cmd_desc.command
|
||||||
if cmd:match('%w') and cmd ~= 'z' and not is_autocmd_cmd(cmd) then
|
if cmd:match('%w') and cmd ~= 'z' and not is_special_cased_cmd(cmd) then
|
||||||
w(' ' .. cmd_kw(prev_cmd, cmd))
|
w(' ' .. cmd_kw(prev_cmd, cmd))
|
||||||
end
|
end
|
||||||
prev_cmd = cmd
|
prev_cmd = cmd
|
||||||
|
Reference in New Issue
Block a user