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:
butwerenotthereyet
2020-01-02 06:06:11 -08:00
committed by Justin M. Keyes
parent 2c62b2fc56
commit cbc8d72fde
7 changed files with 502 additions and 9 deletions

View File

@@ -459,6 +459,7 @@ EXTERN frame_T *topframe; /* top of the window frame tree */
* one in the list, "curtab" is the current one.
*/
EXTERN tabpage_T *first_tabpage;
EXTERN tabpage_T *lastused_tabpage;
EXTERN tabpage_T *curtab;
EXTERN int redraw_tabline INIT(= FALSE); /* need to redraw tabline */