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)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 96eac7f..502f33e 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5412,6 +5412,15 @@
{
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)
{