mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
patch 8.2.2603: Vim9: no effect if user command is also a function
Problem: Vim9: no effect if user command is also a function. Solution: Check for paren following. (closes #7960)
This commit is contained in:
@@ -364,9 +364,8 @@ def Test_method_call_linebreak()
|
||||
return F()
|
||||
enddef
|
||||
def Test()
|
||||
Foo
|
||||
->Bar()
|
||||
->setline(1)
|
||||
Foo ->Bar()
|
||||
->setline(1)
|
||||
enddef
|
||||
Test()
|
||||
assert_equal('the text', getline(1))
|
||||
@@ -401,8 +400,7 @@ def Test_method_call_linebreak()
|
||||
return F()
|
||||
enddef
|
||||
|
||||
Foo
|
||||
->Bar()
|
||||
Foo->Bar()
|
||||
->setline(1)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
@@ -424,6 +422,33 @@ def Test_method_call_whitespace()
|
||||
CheckDefAndScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_method_and_user_command()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
def Cmd()
|
||||
g:didFunc = 1
|
||||
enddef
|
||||
command Cmd g:didCmd = 1
|
||||
Cmd
|
||||
assert_equal(1, g:didCmd)
|
||||
Cmd()
|
||||
assert_equal(1, g:didFunc)
|
||||
unlet g:didFunc
|
||||
unlet g:didCmd
|
||||
|
||||
def InDefFunc()
|
||||
Cmd
|
||||
assert_equal(1, g:didCmd)
|
||||
Cmd()
|
||||
assert_equal(1, g:didFunc)
|
||||
unlet g:didFunc
|
||||
unlet g:didCmd
|
||||
enddef
|
||||
InDefFunc()
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_skipped_expr_linebreak()
|
||||
if 0
|
||||
var x = []
|
||||
|
Reference in New Issue
Block a user