runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)
Commit:
https://github.com/vim/vim/commit/1624970d321cfb637ac76232df9c9b3f2fae904c
Author: dkearns <[email protected]>
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
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
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1rdEIe-00Cwd0-QT%40256bit.org.