summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:40:16 +0000
commit6af24b2457752c0d36aaf9f29f03d39afd09937f (patch)
tree2671b594908d1f971de6b2a2d473f97dfb7291d2 /src/ex_cmds2.c
parentReleasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff)
downloadvim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz
vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 0bde730..4a6f519 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -457,6 +457,36 @@ ex_listdo(exarg_T *eap)
tabpage_T *tp;
buf_T *buf = curbuf;
int next_fnum = 0;
+
+ if (curwin->w_p_wfb)
+ {
+ if ((eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) &&
+ !eap->forceit)
+ {
+ // Disallow :ldo if 'winfixbuf' is applied
+ emsg(_(e_winfixbuf_cannot_go_to_buffer));
+ return;
+ }
+
+ if (win_valid(prevwin) && !prevwin->w_p_wfb)
+ // 'winfixbuf' is set; attempt to change to a window without it.
+ win_goto(prevwin);
+ if (curwin->w_p_wfb)
+ {
+ // Split the window, which will be 'nowinfixbuf', and set curwin to
+ // that
+ (void)win_split(0, 0);
+
+ if (curwin->w_p_wfb)
+ {
+ // Autocommands set 'winfixbuf' or sent us to another window
+ // with it set, or we failed to split the window. Give up.
+ emsg(_(e_winfixbuf_cannot_go_to_buffer));
+ return;
+ }
+ }
+ }
+
#if defined(FEAT_SYN_HL)
char_u *save_ei = NULL;
#endif