refactor(aucmd_win): remove need to restore window layout

There are some places that mess with the window layout in preparation for moving
a window to a different split (win_split_ins called with new_wp != NULL).

This means the window layout can change slightly even if win_split_ins fails.

This is why it was still needed to restore the window layout in
aucmd_{prep,rest}buf even if we disallow win_split_ins from making aucmd_win
non-floating by moving it into a split.

We can just skip messing with the layout in such places if we're dealing with
the aucmd_win.
This commit is contained in:
Sean Dewar
2022-02-22 21:06:53 +00:00
parent 2deffb5ea8
commit 430371da5b
3 changed files with 4 additions and 4 deletions

View File

@@ -1838,6 +1838,9 @@ static void win_totop(int size, int flags)
beep_flush();
return;
}
if (curwin == aucmd_win) {
return;
}
if (curwin->w_floating) {
ui_comp_remove_grid(&curwin->w_grid_alloc);