comparison src/evalfunc.c @ 27807:292a6bd86c30 v8.2.4429

patch 8.2.4429: using script-local function from the wrong script Commit: https://github.com/vim/vim/commit/c2f17f7e64bb1bf872dbc6f3b8f0d8751e275287 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 21 13:13:50 2022 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Feb 2022 14:15:04 +0100
parents 6e5d378919c4
children f68947167523
comparison
equal deleted inserted replaced
27806:c8db1c5f9303 27807:292a6bd86c30
568 { 568 {
569 if (context->arg_types[0].type_curr->tt_type == VAR_STRING 569 if (context->arg_types[0].type_curr->tt_type == VAR_STRING
570 || context->arg_types[0].type_curr->tt_type == VAR_BLOB 570 || context->arg_types[0].type_curr->tt_type == VAR_BLOB
571 || context->arg_types[0].type_curr->tt_type == VAR_LIST) 571 || context->arg_types[0].type_curr->tt_type == VAR_LIST)
572 args[0] = &t_number; 572 args[0] = &t_number;
573 else if (context->arg_types[0].type_curr->tt_type == VAR_DICT) 573 else if (context->arg_types[0].type_decl->tt_type == VAR_DICT)
574 args[0] = &t_string; 574 args[0] = &t_string;
575 if (args[0] != NULL) 575 if (args[0] != NULL)
576 args[1] = expected_ret; 576 args[1] = expected_ret;
577 } 577 }
578 } 578 }
4364 // Expand s: and <SID> into <SNR>nr_, so that the function can 4364 // Expand s: and <SID> into <SNR>nr_, so that the function can
4365 // also be called from another script. Using trans_function_name() 4365 // also be called from another script. Using trans_function_name()
4366 // would also work, but some plugins depend on the name being 4366 // would also work, but some plugins depend on the name being
4367 // printable text. 4367 // printable text.
4368 name = get_scriptlocal_funcname(s); 4368 name = get_scriptlocal_funcname(s);
4369 else if (trans_name != NULL && *trans_name == K_SPECIAL)
4370 name = alloc_printable_func_name(trans_name);
4369 else 4371 else
4370 name = vim_strsave(s); 4372 name = vim_strsave(s);
4371 4373
4372 if (argvars[1].v_type != VAR_UNKNOWN) 4374 if (argvars[1].v_type != VAR_UNKNOWN)
4373 { 4375 {