runtime(vim): Update base-syntax, improve :map highlighting

Match :map ( RHS properly.

Only match ! after :map, :noremap, :unmap and :mapclear.

closes: #15297

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2024-07-18 20:45:19 +02:00
committed by Christian Brabandt
parent 1165f7850b
commit 99984fc58a
126 changed files with 786 additions and 561 deletions

View File

@ -313,7 +313,6 @@ vim9script
:lwindow
:make
:mapclear
# requires trailing whitespace to distinguish from map()
:map
:mark
:marks
@ -902,8 +901,7 @@ Foo() | lwindow
Foo() | make
Foo() | mark
Foo() | move
# requires trailing whitespace to distinguish from map()
Foo() | map
Foo() | map
Foo() | mapclear
Foo() | marks
Foo() | match

View File

@ -0,0 +1,51 @@
" Vim :call command
" functions for which there are same-named Ex commands
call browse(save, title, initdir, default)
call call(func, arglist, dict)
call chdir(dir)
call confirm(msg, choices, default, type)
call copy(expr)
call delete(fname, flags)
call eval(string)
call execute(command)
call filter(expr1, expr2)
call function(name, arglist, dict)
call insert(object, item, idx)
call join(list, sep)
call map(expr1, expr2)
call match(expr, pat, start, count)
call mode(expr)
call sort(list, how, dict)
call split(string, pattern, keepempty)
call substitute(str, pat, sub, flags)
call swapname(buf)
call browse (save, title, initdir, default)
call call (func, arglist, dict)
call chdir (dir)
call confirm (msg, choices, default, type)
call copy (expr)
call delete (fname, flags)
call eval (string)
call execute (command)
call filter (expr1, expr2)
call function (name, arglist, dict)
call insert (object, item, idx)
call join (list, sep)
call map (expr1, expr2)
call match (expr, pat, start, count)
call mode (expr)
call sort (list, how, dict)
call split (string, pattern, keepempty)
call substitute (str, pat, sub, flags)
call swapname (buf)
call Foo()
call Foo(arg1)
call Foo(arg1, arg2)
let res = call(func, arglist, dict)
let res = call (func, arglist, dict)

View File

@ -310,8 +310,7 @@
:move
:mark
:make
" requires trailing whitespace to distinguish from map()
:map
:map
:mapclear
:marks
:match
@ -899,8 +898,7 @@ call Foo() | lwindow
call Foo() | move
call Foo() | mark
call Foo() | make
" requires trailing whitespace to distinguish from map()
call Foo() | map
call Foo() | map
call Foo() | mapclear
call Foo() | marks
call Foo() | match

View File

@ -5,9 +5,6 @@ map! lhs rhs
map
map lhs rhs
call map(list, 'v:val')
call map (list, 'v:val')
mapclear <buffer>
mapclear! <buffer>
nmapclear <buffer>
@ -69,6 +66,27 @@ map lhs
echo "clear"
" Differentiate map() from :map
map ( :echo "open-paren"<CR>
call map(list, 'v:val')
call map (list, 'v:val')
function Foo()
map ( :echo "open-paren"<CR>
call map(list, 'v:val')
call map (list, 'v:val')
endfunction
def Foo()
map ( :echo "open-paren"<CR>
map(list, 'v:val')
# :map LHS=(list, RHS='v:val')
map (list, 'v:val')
enddef
" Issue #12672
nnoremap <leader>foo :echo call(

View File

@ -11,3 +11,22 @@ match none
3match FooGroup /Foo/
3match
3match none
" Differentiate map() from :map
call match(haystack, 'needle')
call match (haystack, 'needle')
function Foo()
match FooGroup /Foo/
call match(haystack, 'needle')
call match (haystack, 'needle')
endfunction
def Foo()
match FooGroup /Foo/
match(haystack, 'needle')
# Error: bad :match command - trailing characters
match (haystack, 'needle')
enddef