Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
23977:182c7ecd2cf3 | 23978:54b2aa1f0d42 |
---|---|
3459 #endif | 3459 #endif |
3460 | 3460 |
3461 /* | 3461 /* |
3462 * Isolate the command and search for it in the command table. | 3462 * Isolate the command and search for it in the command table. |
3463 * Exceptions: | 3463 * Exceptions: |
3464 * - the 'k' command can directly be followed by any character. | 3464 * - The 'k' command can directly be followed by any character. |
3465 * But it is not used in Vim9 script. | |
3465 * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r' | 3466 * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r' |
3466 * but :sre[wind] is another command, as are :scr[iptnames], | 3467 * but :sre[wind] is another command, as are :scr[iptnames], |
3467 * :scs[cope], :sim[alt], :sig[ns] and :sil[ent]. | 3468 * :scs[cope], :sim[alt], :sig[ns] and :sil[ent]. |
3468 * - the "d" command can directly be followed by 'l' or 'p' flag. | 3469 * - the "d" command can directly be followed by 'l' or 'p' flag. |
3469 */ | 3470 */ |
8054 static void | 8055 static void |
8055 ex_mark(exarg_T *eap) | 8056 ex_mark(exarg_T *eap) |
8056 { | 8057 { |
8057 pos_T pos; | 8058 pos_T pos; |
8058 | 8059 |
8060 #ifdef FEAT_EVAL | |
8061 if (not_in_vim9(eap) == FAIL) | |
8062 return; | |
8063 #endif | |
8059 if (*eap->arg == NUL) // No argument? | 8064 if (*eap->arg == NUL) // No argument? |
8060 emsg(_(e_argreq)); | 8065 emsg(_(e_argreq)); |
8061 else if (eap->arg[1] != NUL) // more than one character? | 8066 else if (eap->arg[1] != NUL) // more than one character? |
8062 semsg(_(e_trailing_arg), eap->arg); | 8067 semsg(_(e_trailing_arg), eap->arg); |
8063 else | 8068 else |