diff src/ex_docmd.c @ 23978:54b2aa1f0d42 v8.2.2531

patch 8.2.2531: Vim9: the :k command is obscure Commit: https://github.com/vim/vim/commit/10b9421f3bb7ac971fa63bd025c4c603c98f4a49 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 19 21:42:57 2021 +0100 patch 8.2.2531: Vim9: the :k command is obscure Problem: Vim9: the :k command is obscure. Solution: Disallow using :k, can use :mark instead. (closes https://github.com/vim/vim/issues/7874)
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Feb 2021 21:45:03 +0100
parents d4f7e4138544
children fc4c2beea99a
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3461,7 +3461,8 @@ find_ex_command(
     /*
      * Isolate the command and search for it in the command table.
      * Exceptions:
-     * - the 'k' command can directly be followed by any character.
+     * - The 'k' command can directly be followed by any character.
+     *   But it is not used in Vim9 script.
      * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
      *	    but :sre[wind] is another command, as are :scr[iptnames],
      *	    :scs[cope], :sim[alt], :sig[ns] and :sil[ent].
@@ -8056,6 +8057,10 @@ ex_mark(exarg_T *eap)
 {
     pos_T	pos;
 
+#ifdef FEAT_EVAL
+    if (not_in_vim9(eap) == FAIL)
+	return;
+#endif
     if (*eap->arg == NUL)		// No argument?
 	emsg(_(e_argreq));
     else if (eap->arg[1] != NUL)	// more than one character?