changeset 25274:84d5cda23b34 v8.2.3174

patch 8.2.3174: Vim9: "legacy undo" finds "undo" variable Commit: https://github.com/vim/vim/commit/47bc9c333766ee3d45cb18c583a630e4ad53405a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 17 21:24:56 2021 +0200 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 https://github.com/vim/vim/issues/8563)
author Bram Moolenaar <Bram@vim.org>
date Sat, 17 Jul 2021 21:30:04 +0200
parents e1b2a8fa0465
children 62202b271367
files src/testdir/test_vim9_assign.vim src/version.c src/vim9compile.c
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -1632,6 +1632,13 @@ def Test_script_local_in_legacy()
     let s:legvar = 'one'
   END
   CheckScriptFailure(lines, 'E476:', 1)
+
+  edit! Xfile
+  lines =<< trim END
+      var edit: bool
+      legacy edit
+  END
+  CheckDefAndScriptSuccess(lines)
 enddef
 
 def Test_var_type_check()
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3174,
+/**/
     3173,
 /**/
     3172,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -9510,7 +9510,8 @@ compile_def_function(
 		}
 	    }
 	}
-	p = find_ex_command(&ea, NULL, starts_with_colon
+	p = find_ex_command(&ea, NULL,
+		starts_with_colon || (local_cmdmod.cmod_flags & CMOD_LEGACY)
 						  ? NULL : item_exists, &cctx);
 
 	if (p == NULL)