Skip to content

Commit 47bc9c3

Browse files
committed
patch 8.2.3174: Vim9: "legacy undo" finds "undo" variable
Problem: Vim9: "legacy undo" finds "undo" variable. Solution: Do not pass lookup function to find_ex_command(). (closes #8563)
1 parent a9a7c0c commit 47bc9c3

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/testdir/test_vim9_assign.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,13 @@ def Test_script_local_in_legacy()
16321632
let s:legvar = 'one'
16331633
END
16341634
CheckScriptFailure(lines, 'E476:', 1)
1635+
1636+
edit! Xfile
1637+
lines =<< trim END
1638+
var edit: bool
1639+
legacy edit
1640+
END
1641+
CheckDefAndScriptSuccess(lines)
16351642
enddef
16361643

16371644
def Test_var_type_check()

src/version.c

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

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3174,
758760
/**/
759761
3173,
760762
/**/

src/vim9compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9510,7 +9510,8 @@ compile_def_function(
95109510
}
95119511
}
95129512
}
9513-
p = find_ex_command(&ea, NULL, starts_with_colon
9513+
p = find_ex_command(&ea, NULL,
9514+
starts_with_colon || (local_cmdmod.cmod_flags & CMOD_LEGACY)
95149515
? NULL : item_exists, &cctx);
95159516

95169517
if (p == NULL)

0 commit comments

Comments
 (0)