mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 9.1.1014: Vim9: variable not found in transitive import
Problem: Vim9: variable not found in transitive import Solution: Allow nested import (Hirohito Higashi) fixe: #16379 closes: #16440 Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
045564d0a7
commit
57f0119358
@@ -778,6 +778,7 @@ get_script_item_idx(
|
||||
static imported_T *
|
||||
find_imported_in_script(char_u *name, size_t len, int sid)
|
||||
{
|
||||
static int nesting = 0;
|
||||
scriptitem_T *si;
|
||||
int idx;
|
||||
|
||||
@@ -792,6 +793,19 @@ find_imported_in_script(char_u *name, size_t len, int sid)
|
||||
: STRLEN(import->imp_name) == len
|
||||
&& STRNCMP(name, import->imp_name, len) == 0)
|
||||
return import;
|
||||
else
|
||||
{
|
||||
if (nesting >= p_mfd)
|
||||
{
|
||||
emsg(_(e_import_nesting_too_deep));
|
||||
return NULL;
|
||||
}
|
||||
++nesting;
|
||||
import = find_imported_in_script(name, len, import->imp_sid);
|
||||
--nesting;
|
||||
if (import != NULL)
|
||||
return import;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user