aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Vigouroux <39092278+vigoux@users.noreply.github.com>2020-08-31 09:53:10 +0200
committerGitHub <noreply@github.com>2020-08-31 00:53:10 -0700
commit24b5f69a4922e53baa46faf4f5e0b05da42cd2d5 (patch)
treeb188808bedd9c6d83ddac05e8c70a3a3b00cad1d /src
parentc2662210b5af8aeced68c9cae540567496926a44 (diff)
downloadrneovim-24b5f69a4922e53baa46faf4f5e0b05da42cd2d5.tar.gz
rneovim-24b5f69a4922e53baa46faf4f5e0b05da42cd2d5.tar.bz2
rneovim-24b5f69a4922e53baa46faf4f5e0b05da42cd2d5.zip
fix(win): ignore closing wins in win_findbuf #12798
This caused segfaults when calling win_findbuf in an `on_detach` callback, when the callback was triggered when closing the last window containing the buffer.
Diffstat (limited to 'src')
-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 0fff93d984..cec0dfd67f 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6986,7 +6986,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_buffer->b_fnum == bufnr) {
+ if (!wp->w_closing && wp->w_buffer->b_fnum == bufnr) {
tv_list_append_number(list, wp->handle);
}
}