aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-11 12:05:01 +0800
committerGitHub <noreply@github.com>2024-03-11 12:05:01 +0800
commit3814750d3789b5c5690e8fa68066bd864a4f0a8e (patch)
tree8958b54539e3b4df3b8e6eebf6f11c7fbecc1662 /src/nvim/buffer.c
parenta09ddd7ce55037edc9747a682810fba6a26bc201 (diff)
parent3b3511c4d9f1855d4240da0d844ce7875176c607 (diff)
downloadrneovim-3814750d3789b5c5690e8fa68066bd864a4f0a8e.tar.gz
rneovim-3814750d3789b5c5690e8fa68066bd864a4f0a8e.tar.bz2
rneovim-3814750d3789b5c5690e8fa68066bd864a4f0a8e.zip
Merge pull request #27738 from ColinKennedy/vim-9.1.0147
vim-patch:9.1.{0147,0149,0150,0152,0156},58f1e5c0893a: 'winfixbuf'
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 7154be36be..e141706edd 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1305,6 +1305,12 @@ int do_buffer(int action, int start, int dir, int count, int forceit)
}
return FAIL;
}
+
+ if (action == DOBUF_GOTO && buf != curbuf && !check_can_set_curbuf_forceit(forceit)) {
+ // disallow navigating to another buffer when 'winfixbuf' is applied
+ return FAIL;
+ }
+
if ((action == DOBUF_GOTO || action == DOBUF_SPLIT) && (buf->b_flags & BF_DUMMY)) {
// disallow navigating to the dummy buffer
semsg(_(e_nobufnr), count);