Skip to content

Commit d9a1f26

Browse files
committed
patch 9.1.1044: Vim9: Patch 9.1.1014 causes regressions
Problem: Vim9: Patch 9.1.1014 causes regressions Solution: revert it for now This reverts commit 57f0119 since this causes some regressions: #16440 (comment) So revert "patch 9.1.1014: Vim9: variable not found in transitive import" for now. Signed-off-by: Christian Brabandt <[email protected]>
1 parent e2a0471 commit d9a1f26

File tree

7 files changed

+13
-95
lines changed

7 files changed

+13
-95
lines changed

runtime/doc/options.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2025 Jan 20
1+
*options.txt* For Vim version 9.1. Last change: 2025 Jan 21
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5582,7 +5582,6 @@ A jump table for the options with a short description can be found at |Q_op|.
55825582
command recursion, see |E169|.
55835583
See also |:function|.
55845584
Also used for maximum depth of callback functions.
5585-
Also used for maximum depth of import. See |:import-cycle|.
55865585

55875586
*'maxmapdepth'* *'mmd'* *E223*
55885587
'maxmapdepth' 'mmd' number (default 1000)

runtime/doc/tags

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4148,7 +4148,6 @@ E1041 vim9.txt /*E1041*
41484148
E1042 vim9.txt /*E1042*
41494149
E1043 vim9.txt /*E1043*
41504150
E1044 vim9.txt /*E1044*
4151-
E1045 vim9.txt /*E1045*
41524151
E1047 vim9.txt /*E1047*
41534152
E1048 vim9.txt /*E1048*
41544153
E1049 vim9.txt /*E1049*

runtime/doc/vim9.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 19
1+
*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2052,14 +2052,13 @@ prefixing the function with |<SID>| you should use|<ScriptCmd>|. For example:
20522052
>
20532053
noremap ,a <ScriptCmd>:call s:that.OtherFunc()<CR>
20542054
<
2055-
*:import-cycle* *E1045*
2056-
The `import` commands are executed when encountered. It can be nested up to
2057-
'maxfuncdepth' levels deep. If script A imports script B, and B (directly or
2058-
indirectly) imports A, this will be skipped over. At this point items in A
2059-
after "import B" will not have been processed and defined yet. Therefore
2060-
cyclic imports can exist and not result in an error directly, but may result
2061-
in an error for items in A after "import B" not being defined. This does not
2062-
apply to autoload imports, see the next section.
2055+
*:import-cycle*
2056+
The `import` commands are executed when encountered. If script A imports
2057+
script B, and B (directly or indirectly) imports A, this will be skipped over.
2058+
At this point items in A after "import B" will not have been processed and
2059+
defined yet. Therefore cyclic imports can exist and not result in an error
2060+
directly, but may result in an error for items in A after "import B" not being
2061+
defined. This does not apply to autoload imports, see the next section.
20632062

20642063

20652064
Importing an autoload script ~

src/errors.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,8 +2738,7 @@ EXTERN char e_invalid_command_after_export[]
27382738
INIT(= N_("E1043: Invalid command after :export"));
27392739
EXTERN char e_export_with_invalid_argument[]
27402740
INIT(= N_("E1044: Export with invalid argument"));
2741-
EXTERN char e_import_nesting_too_deep[]
2742-
INIT(= N_("E1045: Import nesting too deep"));
2741+
// E1045 not used
27432742
// E1046 not used
27442743
EXTERN char e_syntax_error_in_import_str[]
27452744
INIT(= N_("E1047: Syntax error in import: %s"));

src/testdir/test_vim9_class.vim

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3662,73 +3662,7 @@ def Test_extend_imported_class()
36623662
v9.CheckScriptSuccess(lines)
36633663
enddef
36643664

3665-
" Test for multi level import
3666-
def Test_multi_level_import_normal()
3667-
var lines =<< trim END
3668-
vim9script
3669-
export class Property
3670-
public var value: string
3671-
endclass
3672-
END
3673-
writefile(lines, 'aa.vim', 'D')
3674-
3675-
lines =<< trim END
3676-
vim9script
3677-
import './aa.vim'
3678-
export class View
3679-
var content = aa.Property.new('')
3680-
endclass
3681-
END
3682-
writefile(lines, 'bb.vim', 'D')
3683-
3684-
lines =<< trim END
3685-
vim9script
3686-
import './bb.vim'
3687-
class MyView extends bb.View
3688-
def new(value: string)
3689-
this.content.value = value
3690-
enddef
3691-
endclass
3692-
var myView = MyView.new('This should be ok')
3693-
END
3694-
v9.CheckScriptSuccess(lines)
3695-
enddef
3696-
3697-
" Test for multi level import
3698-
def Test_multi_level_import_nest_over()
3699-
var lines =<< trim END
3700-
vim9script
3701-
import './xbb.vim'
3702-
export class Property
3703-
public var value: string
3704-
endclass
3705-
END
3706-
writefile(lines, 'xaa.vim', 'D')
3707-
3708-
lines =<< trim END
3709-
vim9script
3710-
import './xaa.vim'
3711-
export class View
3712-
var content = aa.Property.new('')
3713-
endclass
3714-
END
3715-
writefile(lines, 'xbb.vim', 'D')
3716-
3717-
lines =<< trim END
3718-
vim9script
3719-
set maxfuncdepth=100
3720-
import './xbb.vim'
3721-
class MyView extends bb.View
3722-
def new(value: string)
3723-
this.content.value = value
3724-
enddef
3725-
endclass
3726-
var myView = MyView.new('This should be ok')
3727-
END
3728-
v9.CheckSourceFailure(lines, 'E1045: Import nesting too deep', 3)
3729-
enddef
3730-
3731-
def Test_abtstract_class()
3665+
def Test_abstract_class()
37323666
var lines =<< trim END
37333667
vim9script
37343668
abstract class Base

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1044,
707709
/**/
708710
1043,
709711
/**/

src/vim9compile.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,6 @@ get_script_item_idx(
778778
static imported_T *
779779
find_imported_in_script(char_u *name, size_t len, int sid)
780780
{
781-
static int nesting = 0;
782781
scriptitem_T *si;
783782
int idx;
784783

@@ -793,19 +792,6 @@ find_imported_in_script(char_u *name, size_t len, int sid)
793792
: STRLEN(import->imp_name) == len
794793
&& STRNCMP(name, import->imp_name, len) == 0)
795794
return import;
796-
else
797-
{
798-
if (nesting >= p_mfd)
799-
{
800-
emsg(_(e_import_nesting_too_deep));
801-
return NULL;
802-
}
803-
++nesting;
804-
import = find_imported_in_script(name, len, import->imp_sid);
805-
--nesting;
806-
if (import != NULL)
807-
return import;
808-
}
809795
}
810796
return NULL;
811797
}

0 commit comments

Comments
 (0)