mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 14:28:18 +00:00
tabpage: track last-used tabpage #11626
In a multi-window scenario, it is possible to return focus to the last accessed window via n_CTRL-W_p. However, in the case of a multi-tab scenario, there was previously no way to return focus to the last accessed *tab*. Here, that ability is added via n_g<tab>. Additionally, the index of the previous tab is exposed via tabpagenr('#'), mirroring the existing functionality of winnr('#').
This commit is contained in:

committed by
Justin M. Keyes

parent
2c62b2fc56
commit
cbc8d72fde
@@ -18172,6 +18172,10 @@ static void f_tabpagenr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
if (arg != NULL) {
|
||||
if (strcmp(arg, "$") == 0) {
|
||||
nr = tabpage_index(NULL) - 1;
|
||||
} else if (strcmp(arg, "#") == 0) {
|
||||
nr = valid_tabpage(lastused_tabpage)
|
||||
? tabpage_index(lastused_tabpage)
|
||||
: nr;
|
||||
} else {
|
||||
EMSG2(_(e_invexpr2), arg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user