diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-27 10:33:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-27 10:33:05 +0800 |
commit | 71b4c30ad6215742ffcb8dfb0fb4df899065cb7a (patch) | |
tree | b4367538dee666321835525be7c5634d26f8fea9 /src/nvim/buffer.c | |
parent | a490db5ba819218e9188cbb51d885dbf3a194000 (diff) | |
parent | ae0a43ec23d9d902d2d9c446dda592873988ea50 (diff) | |
download | rneovim-71b4c30ad6215742ffcb8dfb0fb4df899065cb7a.tar.gz rneovim-71b4c30ad6215742ffcb8dfb0fb4df899065cb7a.tar.bz2 rneovim-71b4c30ad6215742ffcb8dfb0fb4df899065cb7a.zip |
Merge pull request #17877 from zeertzjq/vim-8.2.4631
vim-patch:8.2.4631: crash when switching window in BufWipeout autocommand
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 4ca752e747..bf592a626d 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -590,6 +590,10 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last) // Remove the buffer from the list. if (wipe_buf) { + // Do not wipe out the buffer if it is used in a window. + if (buf->b_nwindows > 0) { + return false; + } if (buf->b_sfname != buf->b_ffname) { XFREE_CLEAR(buf->b_sfname); } else { |