0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1413: previous tab page not usable from an Ex command

Problem:    Previous tab page not usable from an Ex command.
Solution:   Add the "#" argument for :tabnext et al. (Yegappan Lakshmanan,
            closes #6677)
This commit is contained in:
Bram Moolenaar
2020-08-10 19:21:15 +02:00
parent 6e4cfffe80
commit 94f4ffa770
5 changed files with 49 additions and 6 deletions

View File

@@ -5412,6 +5412,15 @@ get_tabpage_arg(exarg_T *eap)
{
if (STRCMP(p, "$") == 0)
tab_number = LAST_TAB_NR;
else if (STRCMP(p, "#") == 0)
if (valid_tabpage(lastused_tabpage))
tab_number = tabpage_index(lastused_tabpage);
else
{
eap->errmsg = ex_errmsg(e_invargval, eap->arg);
tab_number = 0;
goto theend;
}
else if (p == p_save || *p_save == '-' || *p != NUL
|| tab_number > LAST_TAB_NR)
{