Commit: runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)

1 view
Skip to first unread message

Christian Brabandt

unread,
Feb 22, 2024, 2:00:10 PMFeb 22
to vim...@googlegroups.com
runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)

Commit: https://github.com/vim/vim/commit/1624970d321cfb637ac76232df9c9b3f2fae904c
Author: dkearns <dougk...@gmail.com>
Date: Fri Feb 23 05:45:05 2024 +1100

runtime(vim): Update base-syntax, fix :unabbrev highlighting (https://github.com/vim/vim/issues/14077)

Fixes issue https://github.com/vim/vim/issues/7876

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

diff --git a/runtime/syntax/generator/gen_syntax_vim.vim b/runtime/syntax/generator/gen_syntax_vim.vim
index 44f701613..bc561dd6c 100644
--- a/runtime/syntax/generator/gen_syntax_vim.vim
+++ b/runtime/syntax/generator/gen_syntax_vim.vim
@@ -273,7 +273,7 @@ function! s:get_vim_command_type(cmd_name)
let menu_prefix = '^\%([acinosvx]\?\|tl\)'
let map_prefix = '^[acilnostvx]\?'
let exclude_list = [
- \ 'map',
+ \ 'map', 'mapclear',
\ 'substitute', 'smagic', 'snomagic',
\ 'setlocal', 'setglobal', 'set', 'var',
\ 'autocmd', 'doautocmd', 'doautoall',
@@ -288,7 +288,7 @@ function! s:get_vim_command_type(cmd_name)

if index(exclude_list, a:cmd_name) != -1
let ret = 99
- elseif a:cmd_name =~# '^\%(abbreviate\|noreabbrev\|\l\%(nore\)\?abbrev\)$'
+ elseif a:cmd_name =~# '^\%(\%(un\)\?abbreviate\|noreabbrev\|\l\%(nore\|un\)\?abbrev\)$'
let ret = 2
elseif a:cmd_name =~# menu_prefix . '\%(nore\|un\)\?menu$'
let ret = 3
diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base
index 8dcdf846c..99a0488b3 100644
--- a/runtime/syntax/generator/vim.vim.base
+++ b/runtime/syntax/generator/vim.vim.base
@@ -454,10 +454,11 @@ syn case match
syn match vimMap "\<map\>\ze\s*(\@!" skipwhite nextgroup=vimMapMod,vimMapLhs
syn match vimMap "\<map!" contains=vimMapBang skipwhite nextgroup=vimMapMod,vimMapLhs
" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs'
-" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR=''
+" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
+syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs'
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
-syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs
+syn match vimMapBang contained " \@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
syn match vimMapMod contained "\%#=1
Reply all
Reply to author
Forward
0 new messages