Compare commits

...

2 Commits

Author SHA1 Message Date
Bram Moolenaar
d25bc23870 updated for version 7.2.409
Problem:    Summary of number of substitutes is incorrect for ":folddo". (Jean
            Johner)
Solution:   Reset sub_nsubs and sub_nlines in global_exe().
2010-03-23 17:49:24 +01:00
Bram Moolenaar
46475520d7 updated for version 7.2.408
Problem:    With ":g/the/s/foo/bar/" the '[ and '] marks can be set to a line
            that was not changed.
Solution:   Only set '[ and '] marks when a substitution was done.
2010-03-23 17:36:29 +01:00
2 changed files with 9 additions and 3 deletions

View File

@@ -4238,6 +4238,7 @@ do_sub(eap)
char_u *sub_firstline; /* allocated copy of first sub line */
int endcolumn = FALSE; /* cursor in last column when done */
pos_T old_cursor = curwin->w_cursor;
int start_nsubs;
cmd = eap->arg;
if (!global_busy)
@@ -4245,6 +4246,7 @@ do_sub(eap)
sub_nsubs = 0;
sub_nlines = 0;
}
start_nsubs = sub_nsubs;
if (eap->cmdidx == CMD_tilde)
which_pat = RE_LAST; /* use last used regexp */
@@ -5106,7 +5108,7 @@ outofmem:
if (do_count)
curwin->w_cursor = old_cursor;
if (sub_nsubs)
if (sub_nsubs > start_nsubs)
{
/* Set the '[ and '] marks. */
curbuf->b_op_start.lnum = eap->line1;
@@ -5236,8 +5238,6 @@ ex_global(eap)
type = *eap->cmd;
cmd = eap->arg;
which_pat = RE_LAST; /* default: use last used regexp */
sub_nsubs = 0;
sub_nlines = 0;
/*
* undocumented vi feature:
@@ -5341,6 +5341,8 @@ global_exe(cmd)
/* When the command writes a message, don't overwrite the command. */
msg_didout = TRUE;
sub_nsubs = 0;
sub_nlines = 0;
global_need_beginline = FALSE;
global_busy = 1;
old_lcount = curbuf->b_ml.ml_line_count;

View File

@@ -681,6 +681,10 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
409,
/**/
408,
/**/
407,
/**/