mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.4330: Vim9: no error if script imports itself
Problem: Vim9: no error if script imports itself. Solution: Give an error when a script imports itself.
This commit is contained in:
@@ -516,6 +516,12 @@ handle_import(
|
||||
goto erret;
|
||||
}
|
||||
|
||||
if (sid == current_sctx.sc_sid)
|
||||
{
|
||||
emsg(_(e_script_cannot_import_itself));
|
||||
goto erret;
|
||||
}
|
||||
|
||||
import_gap = gap != NULL ? gap : &SCRIPT_ITEM(import_sid)->sn_imports;
|
||||
for (i = 0; i < import_gap->ga_len; ++i)
|
||||
{
|
||||
|
Reference in New Issue
Block a user