aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/help.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-23 18:55:11 +0800
committerGitHub <noreply@github.com>2023-01-23 18:55:11 +0800
commit0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3 (patch)
treea12edba6f135a7b2ca9fa49f9c95f09d1a56f12e /src/nvim/help.c
parentd58bf4ff307060829ba01f41dca52416105243d3 (diff)
downloadrneovim-0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3.tar.gz
rneovim-0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3.tar.bz2
rneovim-0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3.zip
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.
Diffstat (limited to 'src/nvim/help.c')
-rw-r--r--src/nvim/help.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/help.c b/src/nvim/help.c
index bbc552fa4c..5d92d4d2ac 100644
--- a/src/nvim/help.c
+++ b/src/nvim/help.c
@@ -220,7 +220,7 @@ void ex_helpclose(exarg_T *eap)
{
FOR_ALL_WINDOWS_IN_TAB(win, curtab) {
if (bt_help(win->w_buffer)) {
- win_close(win, false, eap->forceit);
+ win_close(win, false);
return;
}
}