mirror of
https://github.com/neovim/neovim.git
synced 2026-09-03 04:43:48 +00:00
fix(session): window sizes lost in tabpages after an excluded window #41478
Problem: `restore_size` is scoped to all of `makeopens()`, so a window excluded by 'sessionoptions' latches it off for every tabpage written afterwards: with `sessionoptions-=terminal`, a terminal in tab 2 makes tab 3 restore with `wincmd =` instead of its stored sizes. Solution: Recompute it per tabpage.
This commit is contained in:
@@ -587,7 +587,6 @@ static int store_session_globals(FILE *fd)
|
||||
static int makeopens(FILE *fd, char *dirnow)
|
||||
{
|
||||
bool only_save_windows = true;
|
||||
bool restore_size = true;
|
||||
win_T *edited_win = NULL;
|
||||
win_T *tab_firstwin;
|
||||
frame_T *tab_topframe;
|
||||
@@ -823,6 +822,7 @@ static int makeopens(FILE *fd, char *dirnow)
|
||||
// Check if window sizes can be restored (no windows omitted).
|
||||
// Remember the window number of the current window after restoring.
|
||||
int nr = 0;
|
||||
bool restore_size = true;
|
||||
for (win_T *wp = tab_firstwin; wp != NULL; wp = wp->w_next) {
|
||||
if (ses_do_win(wp)) {
|
||||
nr++;
|
||||
|
||||
Reference in New Issue
Block a user