char_u *func;
partial_T *partial = NULL;
dict_T *selfdict = NULL;
+ char_u *dot;
+ char_u *tofree = NULL;
if (in_vim9script()
&& (check_for_string_or_func_arg(argvars, 0) == FAIL
if (func == NULL || *func == NUL)
return; // type error, empty name or null function
+ dot = vim_strchr(func, '.');
+ if (dot != NULL)
+ {
+ imported_T *import = find_imported(func, dot - func, TRUE, NULL);
+
+ if (import != NULL && SCRIPT_ID_VALID(import->imp_sid))
+ {
+ scriptitem_T *si = SCRIPT_ITEM(import->imp_sid);
+
+ if (si->sn_autoload_prefix != NULL)
+ {
+ // Turn "import.Func" into "scriptname#Func".
+ tofree = concat_str(si->sn_autoload_prefix, dot + 1);
+ if (tofree == NULL)
+ return;
+ func = tofree;
+ }
+ }
+ }
+
if (argvars[2].v_type != VAR_UNKNOWN)
{
if (argvars[2].v_type != VAR_DICT)
}
(void)func_call(func, &argvars[1], partial, selfdict, rettv);
+
+ vim_free(tofree);
}
/*
edit! otherfile
redraw
- set foldexpr= foldmethod&
+ set foldexpr= foldmethod& debug=
bwipe!
delete('Xdir', 'rf')
&rtp = save_rtp
call another.Getother()
assert_equal('other', g:result)
+
+ assert_equal('arg', call('another.RetArg', ['arg']))
END
CheckScriptSuccess(lines)