mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.2735: Vim9: function reference found with prefix, not without
Problem: Vim9: function reference found with prefix, not without. Solution: Also find function reference without prefix.
This commit is contained in:
@@ -2102,6 +2102,29 @@ def Test_expr7_funcref()
|
||||
assert_equal(123, FuncRef())
|
||||
END
|
||||
CheckDefAndScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
func g:GlobalFunc()
|
||||
return 'global'
|
||||
endfunc
|
||||
func s:ScriptFunc()
|
||||
return 'script'
|
||||
endfunc
|
||||
def Test()
|
||||
var Ref = g:GlobalFunc
|
||||
assert_equal('global', Ref())
|
||||
Ref = GlobalFunc
|
||||
assert_equal('global', Ref())
|
||||
|
||||
Ref = s:ScriptFunc
|
||||
assert_equal('script', Ref())
|
||||
Ref = ScriptFunc
|
||||
assert_equal('script', Ref())
|
||||
enddef
|
||||
Test()
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
let g:test_space_dict = {'': 'empty', ' ': 'space'}
|
||||
|
Reference in New Issue
Block a user