mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
The end marker must appear on line of its own without any trailing whitespace. Whitespace is incorrectly allowed before all end markers. Limiting this only to heredocs where "trim" was specified, and with the correct indent, is currently an intractable problem given that contained syntax groups (in this case :let) cannot be limited to start patterns. Highlight interpolated expressions when "eval" is specified. cloess: #15511 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
131 lines
1.3 KiB
VimL
131 lines
1.3 KiB
VimL
" Vim :def command
|
|
" VIM_TEST_SETUP let g:vimsyn_folding = "f" | set fdm=syntax
|
|
|
|
|
|
" list
|
|
|
|
def
|
|
def Foo
|
|
def /Foo.*
|
|
|
|
def | echo "Foo"
|
|
def " comment
|
|
def Foo | echo "Foo"
|
|
def Foo " comment
|
|
|
|
|
|
" definition
|
|
|
|
" empty definition
|
|
def Foo()
|
|
enddef
|
|
|
|
def Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
" trailing whitespace
|
|
def Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
def Foo() # comment
|
|
enddef
|
|
|
|
def Foo(): number # comment
|
|
return 42
|
|
enddef
|
|
|
|
def! Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
def g:Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
def s:Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
def <SID>Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
def foo#bar#Foo(): number
|
|
return 42
|
|
enddef
|
|
|
|
" same name as an Ex command
|
|
def s:ls()
|
|
enddef
|
|
|
|
|
|
" return types
|
|
|
|
def Foo(): void
|
|
enddef
|
|
|
|
def Foo(): void # comment
|
|
enddef
|
|
|
|
def Foo(): list<dict<number>>
|
|
enddef
|
|
|
|
def Foo(): func(dict<list<number>>, func, bool, func(number, list<number>)): bool
|
|
enddef
|
|
|
|
|
|
" :enddef trailing
|
|
|
|
def Foo()
|
|
# trailing whitespace
|
|
enddef
|
|
|
|
def Foo()
|
|
enddef | echo "Foo"
|
|
|
|
def Foo()
|
|
enddef # comment
|
|
|
|
|
|
" parameters
|
|
|
|
def Foo(x: bool, y = 42, z: string = "zed")
|
|
enddef
|
|
|
|
def Foo(
|
|
x: bool,
|
|
y = 42,
|
|
z: string = "zed")
|
|
enddef
|
|
|
|
|
|
" comments
|
|
|
|
def Foo()
|
|
# Vim9-script comment
|
|
"useless string"
|
|
enddef
|
|
|
|
|
|
" fold-region ending
|
|
|
|
def Foo()
|
|
# enddef
|
|
enddef
|
|
|
|
def Foo()
|
|
echo "enddef"
|
|
enddef
|
|
|
|
def Foo()
|
|
var x =<< trim END
|
|
endfunction
|
|
END
|
|
enddef
|
|
|
|
:def Foo()
|
|
:enddef
|
|
|