vim-patch:9.0.0217: 'shellslash' works differently when sourcing a script again

Problem:    'shellslash' works differently when sourcing a script again.
Solution:   Use the name from the script item. (closes vim/vim#10920)
5a4fff4d94
This commit is contained in:
zeertzjq
2022-08-16 05:37:49 +08:00
parent e954d62527
commit 1d28bbf1e5
2 changed files with 29 additions and 4 deletions

View File

@@ -1941,9 +1941,6 @@ int do_source(char *fname, int check_other, int is_vimrc)
cookie.level = ex_nesting_level;
// Keep the sourcing name/lnum, for recursive calls.
estack_push(ETYPE_SCRIPT, fname_exp, 0);
// start measuring script load time if --startuptime was passed and
// time_fd was successfully opened afterwards.
proftime_T rel_time;
@@ -1966,6 +1963,9 @@ int do_source(char *fname, int check_other, int is_vimrc)
const sctx_T save_current_sctx = current_sctx;
si = get_current_script_id(&fname_exp, &current_sctx);
// Keep the sourcing name/lnum, for recursive calls.
estack_push(ETYPE_SCRIPT, (char *)si->sn_name, 0);
if (l_do_profiling == PROF_YES) {
bool forceit = false;