]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.185 v7.3.185
authorBram Moolenaar <Bram@vim.org>
Tue, 10 May 2011 14:00:47 +0000 (16:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 May 2011 14:00:47 +0000 (16:00 +0200)
Problem:    ":windo g/pattern/q" closes windows and reports "N more lines".
            (Tim Chase)
Solution:   Remember what buffer ":global" started in. (Jean-Rene David)

src/ex_cmds.c
src/version.c

index fba7aa101ed7868bc3e534c31279c062af111839..2acb8edd1a7f7a7808eb268d9ce18ebd620a4149 100644 (file)
@@ -5365,8 +5365,9 @@ ex_global(eap)
 global_exe(cmd)
     char_u     *cmd;
 {
-    linenr_T   old_lcount;     /* b_ml.ml_line_count before the command */
-    linenr_T   lnum;           /* line number according to old situation */
+    linenr_T old_lcount;       /* b_ml.ml_line_count before the command */
+    buf_T    *old_buf = curbuf;        /* remember what buffer we started in */
+    linenr_T lnum;             /* line number according to old situation */
 
     /*
      * Set current position only once for a global command.
@@ -5410,8 +5411,10 @@ global_exe(cmd)
        msg_didout = FALSE;
 
     /* If substitutes done, report number of substitutes, otherwise report
-     * number of extra or deleted lines. */
-    if (!do_sub_msg(FALSE))
+     * number of extra or deleted lines.
+     * Don't report extra or deleted lines in the edge case where the buffer
+     * we are in after execution is different from the buffer we started in. */
+    if (!do_sub_msg(FALSE) && curbuf == old_buf)
        msgmore(curbuf->b_ml.ml_line_count - old_lcount);
 }
 
index 99369b226422f8ff1e91ca6b43a1d62719676932..f2978cc8ebdeada7c937e4861ec5bc219be18091 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    185,
 /**/
     184,
 /**/