1
0
forked from aniani/vim

patch 8.2.4429: using script-local function from the wrong script

Problem:    Using script-local function from the wrong script when using a
            partial. (Yegappan Lakshmanan)
Solution:   Include the script ID in the partial name.
This commit is contained in:
Bram Moolenaar
2022-02-21 13:13:50 +00:00
parent 0f6e28f686
commit c2f17f7e64
6 changed files with 81 additions and 7 deletions

View File

@@ -570,7 +570,7 @@ arg_map_func(type_T *type, type_T *decl_type UNUSED, argcontext_T *context)
|| context->arg_types[0].type_curr->tt_type == VAR_BLOB
|| context->arg_types[0].type_curr->tt_type == VAR_LIST)
args[0] = &t_number;
else if (context->arg_types[0].type_curr->tt_type == VAR_DICT)
else if (context->arg_types[0].type_decl->tt_type == VAR_DICT)
args[0] = &t_string;
if (args[0] != NULL)
args[1] = expected_ret;
@@ -4366,6 +4366,8 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
// would also work, but some plugins depend on the name being
// printable text.
name = get_scriptlocal_funcname(s);
else if (trans_name != NULL && *trans_name == K_SPECIAL)
name = alloc_printable_func_name(trans_name);
else
name = vim_strsave(s);