components/vim/vim72-patches/7.2.408
changeset 379 c6a17bba1da3
parent 378 f0b61ed1d10d
child 380 e92b3b4a1c66
equal deleted inserted replaced
378:f0b61ed1d10d 379:c6a17bba1da3
     1 To: [email protected]
       
     2 Subject: Patch 7.2.408
       
     3 Fcc: outbox
       
     4 From: Bram Moolenaar <[email protected]>
       
     5 Mime-Version: 1.0
       
     6 Content-Type: text/plain; charset=UTF-8
       
     7 Content-Transfer-Encoding: 8bit
       
     8 ------------
       
     9 
       
    10 Patch 7.2.408
       
    11 Problem:    With ":g/the/s/foo/bar/" the '[ and '] marks can be set to a line
       
    12 	    that was not changed.
       
    13 Solution:   Only set '[ and '] marks when a substitution was done.
       
    14 Files:	    src/ex_cmds.c
       
    15 
       
    16 
       
    17 *** ../vim-7.2.407/src/ex_cmds.c	2009-07-09 20:06:30.000000000 +0200
       
    18 --- src/ex_cmds.c	2010-03-23 17:31:17.000000000 +0100
       
    19 ***************
       
    20 *** 4238,4243 ****
       
    21 --- 4238,4244 ----
       
    22       char_u	*sub_firstline;		/* allocated copy of first sub line */
       
    23       int		endcolumn = FALSE;	/* cursor in last column when done */
       
    24       pos_T	old_cursor = curwin->w_cursor;
       
    25 +     int		start_nsubs;
       
    26   
       
    27       cmd = eap->arg;
       
    28       if (!global_busy)
       
    29 ***************
       
    30 *** 4245,4250 ****
       
    31 --- 4246,4252 ----
       
    32   	sub_nsubs = 0;
       
    33   	sub_nlines = 0;
       
    34       }
       
    35 +     start_nsubs = sub_nsubs;
       
    36   
       
    37       if (eap->cmdidx == CMD_tilde)
       
    38   	which_pat = RE_LAST;	/* use last used regexp */
       
    39 ***************
       
    40 *** 5106,5112 ****
       
    41       if (do_count)
       
    42   	curwin->w_cursor = old_cursor;
       
    43   
       
    44 !     if (sub_nsubs)
       
    45       {
       
    46   	/* Set the '[ and '] marks. */
       
    47   	curbuf->b_op_start.lnum = eap->line1;
       
    48 --- 5108,5114 ----
       
    49       if (do_count)
       
    50   	curwin->w_cursor = old_cursor;
       
    51   
       
    52 !     if (sub_nsubs > start_nsubs)
       
    53       {
       
    54   	/* Set the '[ and '] marks. */
       
    55   	curbuf->b_op_start.lnum = eap->line1;
       
    56 *** ../vim-7.2.407/src/version.c	2010-03-23 16:27:15.000000000 +0100
       
    57 --- src/version.c	2010-03-23 17:35:40.000000000 +0100
       
    58 ***************
       
    59 *** 683,684 ****
       
    60 --- 683,686 ----
       
    61   {   /* Add new patch number below this line */
       
    62 + /**/
       
    63 +     408,
       
    64   /**/
       
    65 
       
    66 -- 
       
    67 Permission is granted to read this message out aloud on Kings Cross Road,
       
    68 London, under the condition that the orator is properly dressed.
       
    69 
       
    70  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
       
    71 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
       
    72 \\\        download, build and distribute -- http://www.A-A-P.org        ///
       
    73  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///