summaryrefslogtreecommitdiffstats
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-09 14:04:42 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-09 14:04:42 +0200
commit62a232506d06f6d1b3b7271801c907d6294dfe84 (patch)
treed95d049e9676ef5b8a63ca9096401ca52dc8b90d /src/normal.c
parent730b24833952f0f4a9a17b7815b0d9f87c609eb8 (diff)
patch 8.2.1401: cannot jump to the last used tabpagev8.2.1401
Problem: Cannot jump to the last used tabpage. Solution: Add g<Tab> and tabpagnr('#'). (Yegappan Lakshmanan, closes #6661, neovim #11626)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index dd79a43aac..cb8e736368 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -5442,7 +5442,7 @@ nv_gomark(cmdarg_T *cap)
}
/*
- * Handle CTRL-O, CTRL-I, "g;" and "g," commands.
+ * Handle CTRL-O, CTRL-I, "g;", "g," and "CTRL-Tab" commands.
*/
static void
nv_pcmark(cmdarg_T *cap)
@@ -5456,6 +5456,12 @@ nv_pcmark(cmdarg_T *cap)
if (!checkclearopq(cap->oap))
{
+ if (cap->cmdchar == TAB && mod_mask == MOD_MASK_CTRL)
+ {
+ if (goto_tabpage_lastused() == FAIL)
+ clearopbeep(cap->oap);
+ return;
+ }
if (cap->cmdchar == 'g')
pos = movechangelist((int)cap->count1);
else
@@ -6310,6 +6316,11 @@ nv_g_cmd(cmdarg_T *cap)
goto_tabpage(-(int)cap->count1);
break;
+ case TAB:
+ if (!checkclearop(oap) && goto_tabpage_lastused() == FAIL)
+ clearopbeep(oap);
+ break;
+
case '+':
case '-': // "g+" and "g-": undo or redo along the timeline
if (!checkclearopq(oap))