diff src/ex_docmd.c @ 24531:3bfec39ce31c v8.2.2805

patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 script Commit: https://github.com/vim/vim/commit/96cf4ba8fb96e5778192d2dab7458b9a7da0a49d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 24 14:15:41 2021 +0200 patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 script Problem: Vim9: cannot use legacy syntax in Vim9 script. Solution: Add the :legacy command.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Apr 2021 14:30:04 +0200
parents 7c4f50c02e18
children 9c404d78d767
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2925,6 +2925,17 @@ parse_command_modifiers(
 			    cmod->cmod_flags |= CMOD_LOCKMARKS;
 			    continue;
 			}
+			if (checkforcmd_noparen(&eap->cmd, "legacy", 3))
+			{
+			    if (ends_excmd2(p, eap->cmd))
+			    {
+				*errormsg =
+				      _(e_vim9cmd_must_be_followed_by_command);
+				return FAIL;
+			    }
+			    cmod->cmod_flags |= CMOD_LEGACY;
+			    continue;
+			}
 
 			if (!checkforcmd_noparen(&eap->cmd, "leftabove", 5))
 			    break;