From 1d28bbf1e53fac5160a24b1194090a4e1c5b6046 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 16 Aug 2022 05:37:49 +0800 Subject: 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) https://github.com/vim/vim/commit/5a4fff4d948cd12a5cf5f637ad2c561815a77d8e --- src/nvim/runtime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/runtime.c') diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 4eb38c2c9e..1ec9cd0e0e 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -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, ¤t_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; -- cgit