Karsten Hopp 27aa63
To: vim-dev@vim.org
Karsten Hopp 27aa63
Subject: patch 7.1.025
Karsten Hopp 27aa63
Fcc: outbox
Karsten Hopp 27aa63
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 27aa63
Mime-Version: 1.0
Karsten Hopp 27aa63
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 27aa63
Content-Transfer-Encoding: 8bit
Karsten Hopp 27aa63
------------
Karsten Hopp 27aa63
Karsten Hopp 27aa63
Patch 7.1.025
Karsten Hopp 27aa63
Problem:    search() and searchpos() don't use match under cursor at start of
Karsten Hopp 27aa63
	    line when using 'bc' flags. (Viktor Kojouharov)
Karsten Hopp 27aa63
Solution:   Don't go to the previous line when the 'c' flag is present.
Karsten Hopp 27aa63
	    Also fix that "j" doesn't move the cursor to the right column.
Karsten Hopp 27aa63
Files:	    src/eval.c, src/search.c
Karsten Hopp 27aa63
Karsten Hopp 27aa63
Karsten Hopp 27aa63
*** ../vim-7.1.024/src/eval.c	Tue Jun 19 17:23:46 2007
Karsten Hopp 27aa63
--- src/eval.c	Thu Jul  5 21:16:31 2007
Karsten Hopp 27aa63
***************
Karsten Hopp 27aa63
*** 13925,13930 ****
Karsten Hopp 27aa63
--- 13925,13932 ----
Karsten Hopp 27aa63
      /* If 'n' flag is used: restore cursor position. */
Karsten Hopp 27aa63
      if (flags & SP_NOMOVE)
Karsten Hopp 27aa63
  	curwin->w_cursor = save_cursor;
Karsten Hopp 27aa63
+     else
Karsten Hopp 27aa63
+ 	curwin->w_set_curswant = TRUE;
Karsten Hopp 27aa63
  theend:
Karsten Hopp 27aa63
      p_ws = save_p_ws;
Karsten Hopp 27aa63
  
Karsten Hopp 27aa63
*** ../vim-7.1.024/src/search.c	Tue Jul 10 13:07:08 2007
Karsten Hopp 27aa63
--- src/search.c	Thu Jul  5 21:18:55 2007
Karsten Hopp 27aa63
***************
Karsten Hopp 27aa63
*** 573,580 ****
Karsten Hopp 27aa63
  	/*
Karsten Hopp 27aa63
  	 * Start searching in current line, unless searching backwards and
Karsten Hopp 27aa63
  	 * we're in column 0.
Karsten Hopp 27aa63
  	 */
Karsten Hopp 27aa63
! 	if (dir == BACKWARD && start_pos.col == 0)
Karsten Hopp 27aa63
  	{
Karsten Hopp 27aa63
  	    lnum = pos->lnum - 1;
Karsten Hopp 27aa63
  	    at_first_line = FALSE;
Karsten Hopp 27aa63
--- 573,584 ----
Karsten Hopp 27aa63
  	/*
Karsten Hopp 27aa63
  	 * Start searching in current line, unless searching backwards and
Karsten Hopp 27aa63
  	 * we're in column 0.
Karsten Hopp 27aa63
+ 	 * If we are searching backwards, in column 0, and not including the
Karsten Hopp 27aa63
+ 	 * current position, gain some efficiency by skipping back a line.
Karsten Hopp 27aa63
+ 	 * Otherwise begin the search in the current line.
Karsten Hopp 27aa63
  	 */
Karsten Hopp 27aa63
! 	if (dir == BACKWARD && start_pos.col == 0
Karsten Hopp 27aa63
! 					     && (options & SEARCH_START) == 0)
Karsten Hopp 27aa63
  	{
Karsten Hopp 27aa63
  	    lnum = pos->lnum - 1;
Karsten Hopp 27aa63
  	    at_first_line = FALSE;
Karsten Hopp 27aa63
*** ../vim-7.1.024/src/version.c	Tue Jul 10 13:07:08 2007
Karsten Hopp 27aa63
--- src/version.c	Tue Jul 10 13:26:13 2007
Karsten Hopp 27aa63
***************
Karsten Hopp 27aa63
*** 668,669 ****
Karsten Hopp 27aa63
--- 668,671 ----
Karsten Hopp 27aa63
  {   /* Add new patch number below this line */
Karsten Hopp 27aa63
+ /**/
Karsten Hopp 27aa63
+     25,
Karsten Hopp 27aa63
  /**/
Karsten Hopp 27aa63
Karsten Hopp 27aa63
-- 
Karsten Hopp 27aa63
SIGFUN -- signature too funny (core dumped)
Karsten Hopp 27aa63
Karsten Hopp 27aa63
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 27aa63
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 27aa63
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 27aa63
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///