3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.155
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.155
3ef2ca
Problem:    ":keeppatterns /pat" does not keep search pattern offset.
3ef2ca
Solution:   Restore the offset after doing the search.
3ef2ca
Files:	    src/search.c, src/testdir/test14.in, src/testdir/test14.ok
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.154/src/search.c	2014-01-14 15:53:47.000000000 +0100
3ef2ca
--- src/search.c	2014-01-14 21:27:32.000000000 +0100
3ef2ca
***************
3ef2ca
*** 1437,1443 ****
3ef2ca
      curwin->w_set_curswant = TRUE;
3ef2ca
  
3ef2ca
  end_do_search:
3ef2ca
!     if (options & SEARCH_KEEP)
3ef2ca
  	spats[0].off = old_off;
3ef2ca
      vim_free(strcopy);
3ef2ca
  
3ef2ca
--- 1437,1443 ----
3ef2ca
      curwin->w_set_curswant = TRUE;
3ef2ca
  
3ef2ca
  end_do_search:
3ef2ca
!     if ((options & SEARCH_KEEP) || cmdmod.keeppatterns)
3ef2ca
  	spats[0].off = old_off;
3ef2ca
      vim_free(strcopy);
3ef2ca
  
3ef2ca
*** ../vim-7.4.154/src/testdir/test14.in	2014-01-14 15:53:47.000000000 +0100
3ef2ca
--- src/testdir/test14.in	2014-01-14 21:13:39.000000000 +0100
3ef2ca
***************
3ef2ca
*** 56,62 ****
3ef2ca
  :$put =@/
3ef2ca
  /^substitute
3ef2ca
  Y:$put =@0
3ef2ca
! :/^search()/,$w >>test.out
3ef2ca
  :qa!
3ef2ca
  ENDTEST
3ef2ca
  
3ef2ca
--- 56,65 ----
3ef2ca
  :$put =@/
3ef2ca
  /^substitute
3ef2ca
  Y:$put =@0
3ef2ca
! /bar /e
3ef2ca
! :$put =@0
3ef2ca
! -:keeppatterns /xyz
3ef2ca
! 0dn:/^search()/,$w >>test.out
3ef2ca
  :qa!
3ef2ca
  ENDTEST
3ef2ca
  
3ef2ca
*** ../vim-7.4.154/src/testdir/test14.ok	2014-01-14 15:53:47.000000000 +0100
3ef2ca
--- src/testdir/test14.ok	2014-01-14 21:16:23.000000000 +0100
3ef2ca
***************
3ef2ca
*** 23,25 ****
3ef2ca
--- 23,26 ----
3ef2ca
  foo
3ef2ca
  ^substitute
3ef2ca
  substitute bar xyz
3ef2ca
+ xyz
3ef2ca
*** ../vim-7.4.154/src/version.c	2014-01-14 19:44:30.000000000 +0100
3ef2ca
--- src/version.c	2014-01-14 21:28:24.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     155,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
164. You got out to buy software, instead of going out for a beer.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///