summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorColin Kennedy <colinvfx@gmail.com>2024-03-03 16:16:47 +0100
committerChristian Brabandt <cb@256bit.org>2024-03-03 16:16:47 +0100
commit215703563757a4464907ead6fb9edaeb7f430bea (patch)
tree380d7492e2fc174d13a073c6fd4e8dae6714030f /src/buffer.c
parent353faa373eb132987a1985cf3abe18c006f8cdf0 (diff)
patch 9.1.0147: Cannot keep a buffer focused in a windowv9.1.0147
Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: #6445 closes: #13903 Signed-off-by: Colin Kennedy <colinvfx@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 8d62e64368..36396e8d28 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1370,6 +1370,13 @@ do_buffer_ext(
if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) && !bt_terminal(buf))
return OK;
#endif
+ if (
+ action == DOBUF_GOTO
+ && buf != curbuf
+ && !check_can_set_curbuf_forceit((flags & DOBUF_FORCEIT) ? TRUE : FALSE))
+ // disallow navigating to another buffer when 'winfixbuf' is applied
+ return FAIL;
+
if ((action == DOBUF_GOTO || action == DOBUF_SPLIT)
&& (buf->b_flags & BF_DUMMY))
{