mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
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
076faac537
This commit is contained in:
@@ -244,8 +244,7 @@ REORDERING TAB PAGES:
|
|||||||
:.tabmove " do nothing
|
:.tabmove " do nothing
|
||||||
:-tabmove " move the tab page to the left
|
:-tabmove " move the tab page to the left
|
||||||
:+tabmove " move the tab page to the right
|
:+tabmove " move the tab page to the right
|
||||||
:0tabmove " move the tab page to the beginning of the tab
|
:0tabmove " move the tab page to the first
|
||||||
" list
|
|
||||||
:tabmove 0 " as above
|
:tabmove 0 " as above
|
||||||
:tabmove " move the tab page to the last
|
:tabmove " move the tab page to the last
|
||||||
:$tabmove " as above
|
:$tabmove " as above
|
||||||
|
@@ -4368,15 +4368,18 @@ static int get_tabpage_arg(exarg_T *eap)
|
|||||||
tab_number = 0;
|
tab_number = 0;
|
||||||
} else {
|
} else {
|
||||||
tab_number = (int)eap->line2;
|
tab_number = (int)eap->line2;
|
||||||
|
if (!unaccept_arg0) {
|
||||||
char *cmdp = eap->cmd;
|
char *cmdp = eap->cmd;
|
||||||
while (--cmdp > *eap->cmdlinep && (*cmdp == ' ' || ascii_isdigit(*cmdp))) {}
|
while (--cmdp > *eap->cmdlinep
|
||||||
if (!unaccept_arg0 && *cmdp == '-') {
|
&& (ascii_iswhite(*cmdp) || ascii_isdigit(*cmdp))) {}
|
||||||
|
if (*cmdp == '-') {
|
||||||
tab_number--;
|
tab_number--;
|
||||||
if (tab_number < unaccept_arg0) {
|
if (tab_number < unaccept_arg0) {
|
||||||
eap->errmsg = _(e_invrange);
|
eap->errmsg = _(e_invrange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (eap->cmdidx) {
|
switch (eap->cmdidx) {
|
||||||
case CMD_tabnext:
|
case CMD_tabnext:
|
||||||
|
@@ -117,10 +117,16 @@ function Test_tabpage()
|
|||||||
call assert_equal(3, tabpagenr())
|
call assert_equal(3, tabpagenr())
|
||||||
+3tabmove
|
+3tabmove
|
||||||
call assert_equal(6, tabpagenr())
|
call assert_equal(6, tabpagenr())
|
||||||
|
silent -tabmove
|
||||||
|
call assert_equal(5, tabpagenr())
|
||||||
|
silent -2 tabmove
|
||||||
|
call assert_equal(3, tabpagenr())
|
||||||
|
silent -2 tabmove
|
||||||
|
call assert_equal(1, tabpagenr())
|
||||||
|
|
||||||
" The following are a no-op
|
|
||||||
norm! 2gt
|
norm! 2gt
|
||||||
call assert_equal(2, tabpagenr())
|
call assert_equal(2, tabpagenr())
|
||||||
|
" The following are a no-op
|
||||||
tabmove 2
|
tabmove 2
|
||||||
call assert_equal(2, tabpagenr())
|
call assert_equal(2, tabpagenr())
|
||||||
2tabmove
|
2tabmove
|
||||||
|
Reference in New Issue
Block a user