On Di, 22 Dez 2015, Ben Fritz wrote:

> Already discussed here:
> https://groups.google.com/d/topic/vim_dev/P8EyOpmNj5A/discussion

Thanks for pointing that out.

> Supposedly the latest unreleased version of LargeFile fixes it for
> LargeFile. I don't remember if I ever tried it. Regardless I'd support
> NoMatchParen restoring current window. But what about the alternate
> window as somebody pointed out in that other thread?

Here is a test patch, that works for :tabdo! and :windo!
I did not invent a solution for :bufdo/cfdo/cdo, since those commands 
already support the '!' and personally, it does not seem to be a problem 
for those commands.

Interestingly, :windo! is already supported. I don't know why or what it 
is supposed to do differently from :windo

diff --git a/src/ex_cmds.h b/src/ex_cmds.h
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1397,7 +1397,7 @@ EX(CMD_tabclose,  "tabclose",     ex_tabclose
                        RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN,
                        ADDR_TABS),
 EX(CMD_tabdo,          "tabdo",        ex_listdo,
-                       NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+                       BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
                        ADDR_TABS),
 EX(CMD_tabedit,                "tabedit",      ex_splitview,
                        BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2438,7 +2438,11 @@ ex_listdo(eap)
     int                i;
 #ifdef FEAT_WINDOWS
     win_T      *wp;
+    win_T      *oldwp = curwin;
+    win_T      *oldprev = prevwin;
     tabpage_T  *tp;
+    tabpage_T  *oldtp = curtab;
+    win_T      *oldtpprev = curtab->tp_prevwin;
 #endif
     buf_T      *buf = curbuf;
     int                next_fnum = 0;
@@ -2660,6 +2664,15 @@ ex_listdo(eap)
        }
        listcmd_busy = FALSE;
     }
+#ifdef FEAT_WINDOWS
+    if ((eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo) && eap->forceit)
+    {
+       curwin = oldwp;
+       prevwin = oldprev;
+       curtab = oldtp;
+       curtab->tp_prevwin = oldtpprev;
+    }
+#endif


Best,
Christian
-- 
Ein geistreicher Humorist als quasi Poet, der, der Fülle seines 
Wissens und Empfindens gedenkend, sich in Tropen auszusprechen 
genötigt fühlt.
                -- Goethe, Maximen und Reflektionen, Nr. 1314

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui