mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 10:55:40 +00:00
refactor(win_close): remove "force", don't pass on "free_buf" (#21921)
Problem: The "force" flag of win_close() complicates the code and adds edge cases where it is not clear what the correct behavior should be. The "free_buf" flag of win_close() is passed on to float windows when closing the last window of a tabpage, which doesn't make much sense. Solution: Remove the "force" flag and always close float windows as if :close! is used when closing the last window of a tabpage, and set the "free_buf" flag for a float window based on whether its buffer can be freed. As 'hidden' is on by default, this change shouldn't affect many people.
This commit is contained in:
@@ -927,7 +927,7 @@ static void arg_all_close_unused_windows(arg_all_state_T *aall)
|
||||
&& (first_tabpage->tp_next == NULL || !aall->had_tab)) {
|
||||
aall->use_firstwin = true;
|
||||
} else {
|
||||
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf), false);
|
||||
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
|
||||
// check if autocommands removed the next window
|
||||
if (!win_valid(wpnext)) {
|
||||
// start all over...
|
||||
|
||||
Reference in New Issue
Block a user