aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-02-22 21:06:53 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-02-23 00:13:17 +0000
commit430371da5ba40a791873b30a900ff34da95a9de4 (patch)
treeccf873251a4a42e0936c21c98bdfd2f7fac12c89 /src/nvim/window.c
parent2deffb5ea8e2fc8dec2cc805dbed849ad6afa4b4 (diff)
downloadrneovim-430371da5ba40a791873b30a900ff34da95a9de4.tar.gz
rneovim-430371da5ba40a791873b30a900ff34da95a9de4.tar.bz2
rneovim-430371da5ba40a791873b30a900ff34da95a9de4.zip
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.
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 549dd18e4f..83048d911f 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -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);