On 20-Feb-2010 Jean Johner <jean.joh...@cea.fr> wrote: > Hello, [...] > It looks like a bug. > > Can you reproduce that. > > Best regards. > > Jean Johner
The attached patch corrects the erroneous message. -- Cheers, Lech -- 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
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 68627a5..d49bae6 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -5150,6 +5150,13 @@ do_sub_msg(count_only) int count_only; /* used 'n' flag for ":s" */ { int len = 0; + int nsubs = sub_nsubs; + int nlines = sub_nlines; + + /* These should be reset here in case global_busy is set during the next + * call to do_sub(). Such a situation takes place when :substitute is + * performed via :folddoopen. */ + sub_nsubs = sub_nlines = 0; /* * Only report substitutions when: @@ -5157,7 +5164,7 @@ do_sub_msg(count_only) * - command was typed by user, or number of changed lines > 'report' * - giving messages is not disabled by 'lazyredraw' */ - if (((sub_nsubs > p_report && (KeyTyped || sub_nlines > 1 || p_report < 1)) + if (((nsubs > p_report && (KeyTyped || nlines > 1 || p_report < 1)) || count_only) && messaging()) { @@ -5166,20 +5173,20 @@ do_sub_msg(count_only) STRCPY(msg_buf, _("(Interrupted) ")); len = (int)STRLEN(msg_buf); } - if (sub_nsubs == 1) + if (nsubs == 1) vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len, "%s", count_only ? _("1 match") : _("1 substitution")); else vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len, count_only ? _("%ld matches") : _("%ld substitutions"), - sub_nsubs); + nsubs); len = (int)STRLEN(msg_buf); - if (sub_nlines == 1) + if (nlines == 1) vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len, "%s", _(" on 1 line")); else vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len, - _(" on %ld lines"), (long)sub_nlines); + _(" on %ld lines"), (long)nlines); if (msg(msg_buf)) /* save message to display it after redraw */ set_keep_msg(msg_buf, 0);