Problem: Vim9: cannot find script-local func using "s:". (Yegappan
Lakshmanan)
Solution: Skip the "s:".
&operatorfunc = ''
enddef
+def Test_use_script_func_name_with_prefix()
+ var lines =<< trim END
+ vim9script
+ func s:Getit()
+ return 'it'
+ endfunc
+ var Fn = s:Getit
+ assert_equal('it', Fn())
+ END
+ CheckScriptSuccess(lines)
+enddef
+
def Test_lambda_type_allocated()
# Check that unreferencing a partial using a lambda can use the variable type
# after the lambda has been freed and does not leak memory.
{
char_u *after_script = NULL;
long sid = 0;
- int find_script_local = in_vim9script()
- && eval_isnamec1(*name) && name[1] != ':';
+ int find_script_local = in_vim9script() && eval_isnamec1(*name)
+ && (name[1] != ':' || *name == 's');
if (find_script_local)
{
// Find script-local function before global one.
- func = find_func_with_sid(name, current_sctx.sc_sid);
+ func = find_func_with_sid(name[0] == 's' && name[1] == ':'
+ ? name + 2 : name, current_sctx.sc_sid);
if (func != NULL)
return func;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3794,
/**/
3793,
/**/