patch 9.1.0147: Cannot keep a buffer focused in a window
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>
diff --git a/src/arglist.c b/src/arglist.c
index 7231332..187e16e 100644
--- a/src/arglist.c
+++ b/src/arglist.c
@@ -682,6 +682,7 @@
int other;
char_u *p;
int old_arg_idx = curwin->w_arg_idx;
+ int is_split_cmd = *eap->cmd == 's';
if (ERROR_IF_ANY_POPUP_WINDOW)
return;
@@ -697,13 +698,18 @@
return;
}
+ if (!is_split_cmd
+ && (&ARGLIST[argn])->ae_fnum != curbuf->b_fnum
+ && !check_can_set_curbuf_forceit(eap->forceit))
+ return;
+
setpcmark();
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
#endif
// split window or create new tab page first
- if (*eap->cmd == 's' || cmdmod.cmod_tab != 0)
+ if (is_split_cmd || cmdmod.cmod_tab != 0)
{
if (win_split(0, 0) == FAIL)
return;