aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-13 06:02:00 +0800
committerGitHub <noreply@github.com>2022-06-12 15:02:00 -0700
commit429c40cce3fce3b5391afef8208d65a80a316018 (patch)
treef468e6244bc01662180306904c0c008999713d22 /src/nvim/window.c
parentfeba56af7d032c948a78c21735502bebe45f8361 (diff)
downloadrneovim-429c40cce3fce3b5391afef8208d65a80a316018.tar.gz
rneovim-429c40cce3fce3b5391afef8208d65a80a316018.tar.bz2
rneovim-429c40cce3fce3b5391afef8208d65a80a316018.zip
fix(buffer): disable buffer-updates before removing from window #18933
There can be other places that access window buffer info (e.g. `tabpagebuflist()`), so checking `w_closing` in `win_findbuf()` doesn't solve the crash in all cases, and may also cause Nvim's behavior to diverge from Vim. Fix #14998
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index f429c493a7..e09a7cd97e 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -7297,7 +7297,7 @@ void win_findbuf(typval_T *argvars, list_T *list)
int bufnr = tv_get_number(&argvars[0]);
FOR_ALL_TAB_WINDOWS(tp, wp) {
- if (!wp->w_closing && wp->w_buffer->b_fnum == bufnr) {
+ if (wp->w_buffer->b_fnum == bufnr) {
tv_list_append_number(list, wp->handle);
}
}