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