summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-10 19:21:15 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-10 19:21:15 +0200
commit94f4ffa7704921a3634e56b878e6dc362bc3d508 (patch)
tree7eab30ba7523cb0c3261e6c4c0e77f12759937d2 /src/ex_docmd.c
parent6e4cfffe809a894ea831fc8011527714481d2857 (diff)
patch 8.2.1413: previous tab page not usable from an Ex commandv8.2.1413
Problem: Previous tab page not usable from an Ex command. Solution: Add the "#" argument for :tabnext et al. (Yegappan Lakshmanan, closes #6677)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 96eac7fbe4..502f33e2a5 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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)
{