diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-09 12:47:40 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-03-09 13:38:32 +0800 |
commit | 33dfb5a383d7afacda35b8fd392ad18d57db2870 (patch) | |
tree | 860dfa50f29daa54a5726abce8c32f2d697cda12 /src/nvim/buffer.c | |
parent | 6416c6bc94fa7ae553a6020d0ed2f07dd34ee3f1 (diff) | |
download | rneovim-33dfb5a383d7afacda35b8fd392ad18d57db2870.tar.gz rneovim-33dfb5a383d7afacda35b8fd392ad18d57db2870.tar.bz2 rneovim-33dfb5a383d7afacda35b8fd392ad18d57db2870.zip |
fix(window): :close may cause Nvim to quit with autocmd and float
Problem: :close may cause Nvim to quit if an autocommand triggered when
closing the buffer closes all other non-floating windows and
there are floating windows.
Solution: Correct the check for the only non-floating window.
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index b013f43ceb..7154be36be 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -568,7 +568,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i } buf->b_locked--; buf->b_locked_split--; - if (abort_if_last && last_nonfloat(win)) { + if (abort_if_last && one_window(win)) { // Autocommands made this the only window. emsg(_(e_auabort)); return false; @@ -587,7 +587,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i } buf->b_locked--; buf->b_locked_split--; - if (abort_if_last && last_nonfloat(win)) { + if (abort_if_last && one_window(win)) { // Autocommands made this the only window. emsg(_(e_auabort)); return false; |