diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-03-23 17:36:29 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-03-23 17:36:29 +0100 |
commit | 46475520d73c86a75c189079de848a36c725bb3b (patch) | |
tree | 53144214c2e242edb9b34a309d032f45e67851f2 | |
parent | 06975a4a98b4ae6ec3e1a18f4ccdf8704bf921cc (diff) | |
download | vim-git-46475520d73c86a75c189079de848a36c725bb3b.tar.gz |
updated for version 7.2.408v7.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.
-rw-r--r-- | src/ex_cmds.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 68627a578..bf5af4044 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -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; diff --git a/src/version.c b/src/version.c index c10a627e8..4fcc9a684 100644 --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 408, +/**/ 407, /**/ 406, |