# HG changeset patch # User Bram Moolenaar # Date 1389731494 -3600 # Node ID fa53233519c693591ce60f9270cf259c07d6cc26 # Parent 26053cad09831b97b9662de65c1e74d80a230ae9 updated for version 7.4.155 Problem: ":keeppatterns /pat" does not keep search pattern offset. Solution: Restore the offset after doing the search. diff --git a/src/search.c b/src/search.c --- 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); diff --git a/src/testdir/test14.in b/src/testdir/test14.in --- 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 diff --git a/src/testdir/test14.ok b/src/testdir/test14.ok --- a/src/testdir/test14.ok +++ b/src/testdir/test14.ok @@ -23,3 +23,4 @@ two foo ^substitute substitute bar xyz +xyz diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 155, +/**/ 154, /**/ 153,