mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1423: Vim9: find global function when looking for script-local
Problem: Vim9: find global function when looking for script-local. Solution: Don't strip prefix if name starts with "s:". (closes #6688)
This commit is contained in:
@@ -203,6 +203,15 @@ def Test_global_local_function()
|
|||||||
assert_equal('local', Func())
|
assert_equal('local', Func())
|
||||||
END
|
END
|
||||||
CheckScriptSuccess(lines)
|
CheckScriptSuccess(lines)
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
def g:Funcy()
|
||||||
|
echo 'funcy'
|
||||||
|
enddef
|
||||||
|
s:Funcy()
|
||||||
|
END
|
||||||
|
CheckScriptFailure(lines, 'E117:')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
func TakesOneArg(arg)
|
func TakesOneArg(arg)
|
||||||
|
@@ -2132,8 +2132,8 @@ call_func(
|
|||||||
char_u *p = untrans_function_name(rfname);
|
char_u *p = untrans_function_name(rfname);
|
||||||
|
|
||||||
// If using Vim9 script try not local to the script.
|
// If using Vim9 script try not local to the script.
|
||||||
// TODO: should not do this if the name started with "s:".
|
// Don't do this if the name starts with "s:".
|
||||||
if (p != NULL)
|
if (p != NULL && (funcname[0] != 's' || funcname[1] != ':'))
|
||||||
fp = find_func(p, is_global, NULL);
|
fp = find_func(p, is_global, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1423,
|
||||||
/**/
|
/**/
|
||||||
1422,
|
1422,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user