]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3174: Vim9: "legacy undo" finds "undo" variable v8.2.3174
authorBram Moolenaar <Bram@vim.org>
Sat, 17 Jul 2021 19:24:56 +0000 (21:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 17 Jul 2021 19:24:56 +0000 (21:24 +0200)
Problem:    Vim9: "legacy undo" finds "undo" variable.
Solution:   Do not pass lookup function to find_ex_command(). (closes #8563)

src/testdir/test_vim9_assign.vim
src/version.c
src/vim9compile.c

index 3599d6c5d1bcae2cd7ea12ad8fee4b147dd7ab2b..a33038c9a1f27ff7a2fa75cabd85821967150639 100644 (file)
@@ -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()
index f7e2c17a0a0c260c51f2bc22cbb0c9859460c931..e1421ddb4eccb6723e1f07cbfacf4fd05cc4ea24 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3174,
 /**/
     3173,
 /**/
index 956ce44eb01621916f8516d7b1e4d973a8d9dfaf..9ae11a54b164c16736e681e23bc4b0e1651db0a2 100644 (file)
@@ -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)