diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-12-31 09:32:04 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-23 00:09:27 +0000 |
commit | 2deffb5ea8e2fc8dec2cc805dbed849ad6afa4b4 (patch) | |
tree | 98c0782b322e9e50028d645a8e26bc69f51794b9 /src/nvim/window.c | |
parent | 30c9c8815b531e0130ebeb9358bc6d3947a6128a (diff) | |
download | rneovim-2deffb5ea8e2fc8dec2cc805dbed849ad6afa4b4.tar.gz rneovim-2deffb5ea8e2fc8dec2cc805dbed849ad6afa4b4.tar.bz2 rneovim-2deffb5ea8e2fc8dec2cc805dbed849ad6afa4b4.zip |
fix(aucmd_win): ensure aucmd_win stays floating
Nvim uses a floating window for the autocmd window, but in certain situations,
it can be made non-floating (`:wincmd J`), which can cause issues due to the
previous setup and cleanup logic for a non-floating aucmd_win being removed from
aucmd_prepbuf and aucmd_restbuf.
This can cause glitchiness and crashes due to the aucmd_win's frame being
invalid after closing its tabpage, for example.
Ensure aucmd_win cannot be made non-floating. The only place this happens is in
win_split_ins if new_wp != NULL.
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 43667377c5..549dd18e4f 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -958,6 +958,11 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) int wmh1; bool did_set_fraction = false; + // aucmd_win should always remain floating + if (new_wp != NULL && new_wp == aucmd_win) { + return FAIL; + } + if (flags & WSP_TOP) { oldwin = firstwin; } else if (flags & WSP_BOT || curwin->w_floating) { |