]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.408 v7.2.408
authorBram Moolenaar <Bram@vim.org>
Tue, 23 Mar 2010 16:36:29 +0000 (17:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 23 Mar 2010 16:36:29 +0000 (17:36 +0100)
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.

src/ex_cmds.c
src/version.c

index 68627a578b7f269417e09d341ec02f79129f2873..bf5af40441a2ef1a94de85a1800535d8a37fb93e 100644 (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;
index c10a627e8fa98e64f36a1ce7bfa648b581043546..4fcc9a6843b714c61f72df8305e48000a16994a3 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    408,
 /**/
     407,
 /**/