aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-19 07:10:22 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-10-19 07:14:59 +0800
commit66933b45dcff8cc9f323a71583bca3698566abb9 (patch)
tree5c0f979e7c17e61b17ec729ad7cb5bd0dc2e1f01 /src/nvim/buffer.c
parent22473672aa1ce005d3841d0838a21cd6c6b721f7 (diff)
downloadrneovim-66933b45dcff8cc9f323a71583bca3698566abb9.tar.gz
rneovim-66933b45dcff8cc9f323a71583bca3698566abb9.tar.bz2
rneovim-66933b45dcff8cc9f323a71583bca3698566abb9.zip
vim-patch:9.0.0789: dummy buffer ends up in a window
Problem: Dummy buffer ends up in a window. Solution: Disallow navigating to a dummy buffer. https://github.com/vim/vim/commit/8f3c3c6cd044e3b5bf08dbfa3b3f04bb3f711bad
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 84ff2fa59b..8016904702 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1224,6 +1224,11 @@ int do_buffer(int action, int start, int dir, int count, int forceit)
}
return FAIL;
}
+ if ((action == DOBUF_GOTO || action == DOBUF_SPLIT) && (buf->b_flags & BF_DUMMY)) {
+ // disallow navigating to the dummy buffer
+ semsg(_(e_nobufnr), count);
+ return FAIL;
+ }
// delete buffer "buf" from memory and/or the list
if (unload) {