diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-24 11:56:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 11:56:22 +0800 |
commit | ff82b2785f161fc14ff6bd8eae497f37ecd14564 (patch) | |
tree | 485a46d944ffa2a729806be74ea28617cc72887e /src/nvim/window.c | |
parent | 2e3611784011a82be239341c00d435cb7cf7b711 (diff) | |
download | rneovim-ff82b2785f161fc14ff6bd8eae497f37ecd14564.tar.gz rneovim-ff82b2785f161fc14ff6bd8eae497f37ecd14564.tar.bz2 rneovim-ff82b2785f161fc14ff6bd8eae497f37ecd14564.zip |
fix(float): don't always switch window when deleting last listed buffer (#17836)
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index bcc7a92b33..fb7878c2f4 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2350,9 +2350,9 @@ void entering_window(win_T *const win) } } -/// Closes all windows for buffer `buf` until there is only one non-floating window. +/// Closes all windows for buffer `buf` unless there is only one non-floating window. /// -/// @param keep_curwin don't close `curwin`, but caller must ensure `curwin` is non-floating. +/// @param keep_curwin don't close `curwin` void close_windows(buf_T *buf, bool keep_curwin) { tabpage_T *tp, *nexttp; @@ -2360,8 +2360,6 @@ void close_windows(buf_T *buf, bool keep_curwin) ++RedrawingDisabled; - assert(!keep_curwin || !curwin->w_floating); - // Start from lastwin to close floating windows with the same buffer first. // When the autocommand window is involved win_close() may need to print an error message. for (win_T *wp = lastwin; wp != NULL && (lastwin == aucmd_win || !one_window(wp));) { |