4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: With ":g/the/s/foo/bar/" the '[ and '] marks can be set to a line
13 Solution: Only set '[ and '] marks when a substitution was done.
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
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;
35 + start_nsubs = sub_nsubs;
37 if (eap->cmdidx == CMD_tilde)
38 which_pat = RE_LAST; /* use last used regexp */
42 curwin->w_cursor = old_cursor;
46 /* Set the '[ and '] marks. */
47 curbuf->b_op_start.lnum = eap->line1;
50 curwin->w_cursor = old_cursor;
52 ! if (sub_nsubs > start_nsubs)
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
61 { /* Add new patch number below this line */
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.
70 /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///