mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user