From c24b442e310f06c3ad9d4763b09bc9cb7dbaca62 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Thu, 12 May 2022 01:08:25 +0100 Subject: fix(runtime/genvimvim): omit s[ubstitute] from vimCommand #18480 It's special cased by the vimSubst syntax group, and isn't present in Vim's vimCommand group. For example, this fixes `call s:Foo()` highlighting `:` as Error in Nvim, as the `s` is parsed as vimCommand rather than as vimUserFunc since `contains=vimCommand` was added to vimUserFunc (and vimFunc) in a rt update. Interestingly, `g:`, `l:`, etc. have the same issues due to :global, :list, etc. Vim also has that problem, so it should ideally be fixed upstream. We could also omit g[lobal] from vimCommand and rely on vimGlobal instead, but it doesn't work in some cases, like when there's a `:` before the command. Also, Vim matches only `g` in vimCommand for some reason, which doesn't produce any highlight for `:global/foo/bar` (with Nvim you at least get some highlights on the `global` bit despite the leading `:`). Also, remove special handling of :py3 in syntax/vim.vim, as the generator seems to have no problems finding it. --- runtime/syntax/vim.vim | 3 --- 1 file changed, 3 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 0e6ec19ff8..5a0dd4f2d7 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -120,9 +120,6 @@ else com! -nargs=* VimFoldt endif -" commands not picked up by the generator (due to non-standard format) {{{2 -syn keyword vimCommand contained py3 - " Deprecated variable options {{{2 if exists("g:vim_minlines") let g:vimsyn_minlines= g:vim_minlines -- cgit