mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622)
Problem: Autoload script sourced twice if sourced directly.
Solution: Do not source an autoload script again. (issue vim/vim#6644)
daa2f36573
Cherry-pick ret_sid changes from patch 8.2.0149.
Use do_in_runtimepath() as that's what source_runtime() calls in Nvim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -2061,10 +2061,15 @@ void nlua_set_sctx(sctx_T *current)
|
||||
break;
|
||||
}
|
||||
char *source_path = fix_fname(info->source + 1);
|
||||
get_current_script_id(&source_path, current);
|
||||
xfree(source_path);
|
||||
current->sc_lnum = info->currentline;
|
||||
int sid = find_script_by_name(source_path);
|
||||
if (sid > 0) {
|
||||
xfree(source_path);
|
||||
} else {
|
||||
new_script_item(source_path, &sid);
|
||||
}
|
||||
current->sc_sid = sid;
|
||||
current->sc_seq = -1;
|
||||
current->sc_lnum = info->currentline;
|
||||
|
||||
cleanup:
|
||||
xfree(info);
|
||||
|
Reference in New Issue
Block a user