1
0
forked from aniani/vim

runtime(vim): Update base-syntax, improve function definition matching

- Fix highlighting of function names including /fu\%[nction]/ (E.g.,
  s:func(), foo.fu(), fu.func())
- Match :delfunction argument.

Reported by Aliaksei Budavei.

closes: #17428

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-06-11 21:16:14 +02:00
committed by Christian Brabandt
parent 6cc9bd4001
commit 51289207f8
52 changed files with 868 additions and 467 deletions

View File

@@ -64,10 +64,48 @@ function <SID>Foo()
return 42
endfunction
function b:dict.Foo()
return 42
endfunction
function w:dict.Foo()
return 42
endfunction
function t:dict.Foo()
return 42
endfunction
function g:dict.Foo()
return 42
endfunction
function s:dict.Foo()
return 42
endfunction
function v:dict.Foo()
return 42
endfunction
function Foo(arg)
let l:dict = {}
function l:dict.BAR()
return 42
endfunction
function a:arg.BAR()
return 42
endfunction
endfunction
function foo#bar#Foo()
return 42
endfunction
function g:foo#bar#Foo()
return 42
endfunction
" same name as an Ex command
function s:ls()
endfunction
@@ -152,6 +190,14 @@ function Foo(
return 42
endfunction
function Foo(
x,
y,
z,
...)
return 42
endfunction
function Foo(x, y = 42, z = "zed")
return 42
endfunction
@@ -163,6 +209,13 @@ function Foo(
return 42
endfunction
function Foo(
x,
y = 42,
z = "zed")
return 42
endfunction
" arguments
@@ -204,25 +257,9 @@ echo "Foo" | function Foo()
endfunction
" delete function
delfunction Foo
delfunction foo.bar
delfunction! Foo
delfunction foo.bar
" Issue https://github.com/vim/vim/pull/17420#issuecomment-2927798687
" (arg named /fu%\[nction]/)
" FIXME
silent! delfunc! func
" Issue https://github.com/vim/vim/pull/17420#issuecomment-2927798687
" (function named /s:fu%\[nction]/)
" FIXME
func! s:func(_, func)
return a:func
endfunc