Mercurial > vim
changeset 5616:fa53233519c6 v7.4.155
updated for version 7.4.155
Problem: ":keeppatterns /pat" does not keep search pattern offset.
Solution: Restore the offset after doing the search.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 14 Jan 2014 21:31:34 +0100 |
parents | 26053cad0983 |
children | a42040fed96c |
files | src/search.c src/testdir/test14.in src/testdir/test14.ok src/version.c |
diffstat | 4 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/search.c +++ b/src/search.c @@ -1437,7 +1437,7 @@ do_search(oap, dirc, pat, count, options curwin->w_set_curswant = TRUE; end_do_search: - if (options & SEARCH_KEEP) + if ((options & SEARCH_KEEP) || cmdmod.keeppatterns) spats[0].off = old_off; vim_free(strcopy);
--- a/src/testdir/test14.in +++ b/src/testdir/test14.in @@ -56,7 +56,10 @@ j:call search('^$', 'c') :$put =@/ /^substitute Y:$put =@0 -:/^search()/,$w >>test.out +/bar /e +:$put =@0 +-:keeppatterns /xyz +0dn:/^search()/,$w >>test.out :qa! ENDTEST