diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-26 05:04:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 05:04:57 +0800 |
commit | fb4e2dbbebb25aae3cc303c030d21bfee850d274 (patch) | |
tree | 65d268ea84bc941a8405316361b0365ddbe32d7b /src/nvim/ex_docmd.c | |
parent | 31c4cb23473a6e3a19a7986fae25c5bfc03b4eda (diff) | |
download | rneovim-fb4e2dbbebb25aae3cc303c030d21bfee850d274.tar.gz rneovim-fb4e2dbbebb25aae3cc303c030d21bfee850d274.tar.bz2 rneovim-fb4e2dbbebb25aae3cc303c030d21bfee850d274.zip |
vim-patch:9.1.0205: Cannot use modifiers before :-Ntabmove (#28031)
Problem: Cannot use modifiers before :-Ntabmove.
Solution: Check backwards from the command instead of checking from the
start of the command line. Slightly adjust docs to make them
more consistent (zeertzjq).
closes: vim/vim#14289
https://github.com/vim/vim/commit/076faac5378cf517baa8c331c57488d39efadec0
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 2454c77334..1009e25081 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4368,12 +4368,15 @@ static int get_tabpage_arg(exarg_T *eap) tab_number = 0; } else { tab_number = (int)eap->line2; - char *cmdp = eap->cmd; - while (--cmdp > *eap->cmdlinep && (*cmdp == ' ' || ascii_isdigit(*cmdp))) {} - if (!unaccept_arg0 && *cmdp == '-') { - tab_number--; - if (tab_number < unaccept_arg0) { - eap->errmsg = _(e_invrange); + if (!unaccept_arg0) { + char *cmdp = eap->cmd; + while (--cmdp > *eap->cmdlinep + && (ascii_iswhite(*cmdp) || ascii_isdigit(*cmdp))) {} + if (*cmdp == '-') { + tab_number--; + if (tab_number < unaccept_arg0) { + eap->errmsg = _(e_invrange); + } } } } |