summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-05-10 16:00:47 +0200
committerBram Moolenaar <Bram@vim.org>2011-05-10 16:00:47 +0200
commitbb99322ef91c79adc7e6a01dec41b2edda3aec26 (patch)
treea5d1c12732cced573686fc2ae3151c74005d4345
parent18e0bfb07ce7bd8e57687152e417a5a4d9743b37 (diff)
downloadvim-bb99322ef91c79adc7e6a01dec41b2edda3aec26.zip
updated for version 7.3.185
Problem: ":windo g/pattern/q" closes windows and reports "N more lines". (Tim Chase) Solution: Remember what buffer ":global" started in. (Jean-Rene David)
-rw-r--r--src/ex_cmds.c11
-rw-r--r--src/version.c2
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index fba7aa101..2acb8edd1 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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);
}
diff --git a/src/version.c b/src/version.c
index 99369b226..f2978cc8e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 185,
+/**/
184,
/**/
183,