Karsten Hopp 9681ca
To: vim_dev@googlegroups.com
Karsten Hopp 9681ca
Subject: Patch 7.3.871
Karsten Hopp 9681ca
Fcc: outbox
Karsten Hopp 9681ca
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 9681ca
Mime-Version: 1.0
Karsten Hopp 9681ca
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 9681ca
Content-Transfer-Encoding: 8bit
Karsten Hopp 9681ca
------------
Karsten Hopp 9681ca
Karsten Hopp 9681ca
Patch 7.3.871
Karsten Hopp 9681ca
Problem:    search('^$', 'c') does not use the empty match under the cursor.
Karsten Hopp 9681ca
Solution:   Special handling of the 'c' flag. (Christian Brabandt)
Karsten Hopp 9681ca
	    Add tests.
Karsten Hopp 9681ca
Files:	    src/search.c, src/testdir/test14.in, src/testdir/test14.ok
Karsten Hopp 9681ca
Karsten Hopp 9681ca
Karsten Hopp 9681ca
*** ../vim-7.3.870/src/search.c	2013-02-20 18:39:07.000000000 +0100
Karsten Hopp 9681ca
--- src/search.c	2013-03-19 15:23:13.000000000 +0100
Karsten Hopp 9681ca
***************
Karsten Hopp 9681ca
*** 727,732 ****
Karsten Hopp 9681ca
--- 727,734 ----
Karsten Hopp 9681ca
  					++matchcol;
Karsten Hopp 9681ca
  				}
Karsten Hopp 9681ca
  			    }
Karsten Hopp 9681ca
+ 			    if (options & SEARCH_START)
Karsten Hopp 9681ca
+ 				break;
Karsten Hopp 9681ca
  			    if (ptr[matchcol] == NUL
Karsten Hopp 9681ca
  				    || (nmatched = vim_regexec_multi(&regmatch,
Karsten Hopp 9681ca
  					      win, buf, lnum + matchpos.lnum,
Karsten Hopp 9681ca
*** ../vim-7.3.870/src/testdir/test14.in	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 9681ca
--- src/testdir/test14.in	2013-03-19 15:21:54.000000000 +0100
Karsten Hopp 9681ca
***************
Karsten Hopp 9681ca
*** 2,7 ****
Karsten Hopp 9681ca
--- 2,8 ----
Karsten Hopp 9681ca
  Also test ":s/pat/sub/" with different ~s in sub.
Karsten Hopp 9681ca
  Also test for ^Vxff and ^Vo123 in Insert mode.
Karsten Hopp 9681ca
  Also test "[m", "]m", "[M" and "]M"
Karsten Hopp 9681ca
+ Also test search()
Karsten Hopp 9681ca
  
Karsten Hopp 9681ca
  STARTTEST
Karsten Hopp 9681ca
  :so small.vim
Karsten Hopp 9681ca
***************
Karsten Hopp 9681ca
*** 34,39 ****
Karsten Hopp 9681ca
--- 35,50 ----
Karsten Hopp 9681ca
  2[MaJ?:.w >>test.out
Karsten Hopp 9681ca
  k[MaK?:.w >>test.out
Karsten Hopp 9681ca
  3[MaL?:.w >>test.out
Karsten Hopp 9681ca
+ :"
Karsten Hopp 9681ca
+ /^foobar
Karsten Hopp 9681ca
+ :let startline = line('.')
Karsten Hopp 9681ca
+ :call search('foobar', 'c')
Karsten Hopp 9681ca
+ :call append(line('$'), line('.') - startline)
Karsten Hopp 9681ca
+ j:call search('^$', 'c')
Karsten Hopp 9681ca
+ :call append(line('$'), line('.') - startline)
Karsten Hopp 9681ca
+ :call search('^$', 'bc')
Karsten Hopp 9681ca
+ :call append(line('$'), line('.') - startline)
Karsten Hopp 9681ca
+ :/^search()/,$w >>test.out
Karsten Hopp 9681ca
  :qa!
Karsten Hopp 9681ca
  ENDTEST
Karsten Hopp 9681ca
  
Karsten Hopp 9681ca
***************
Karsten Hopp 9681ca
*** 64,66 ****
Karsten Hopp 9681ca
--- 75,82 ----
Karsten Hopp 9681ca
  		}
Karsten Hopp 9681ca
  	} e3
Karsten Hopp 9681ca
  }
Karsten Hopp 9681ca
+ 
Karsten Hopp 9681ca
+ foobar
Karsten Hopp 9681ca
+ 
Karsten Hopp 9681ca
+ 
Karsten Hopp 9681ca
+ search()
Karsten Hopp 9681ca
*** ../vim-7.3.870/src/testdir/test14.ok	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 9681ca
--- src/testdir/test14.ok	2013-03-19 15:26:18.000000000 +0100
Karsten Hopp 9681ca
***************
Karsten Hopp 9681ca
*** 15,17 ****
Karsten Hopp 9681ca
--- 15,21 ----
Karsten Hopp 9681ca
  	}JH e3
Karsten Hopp 9681ca
  	}K e2
Karsten Hopp 9681ca
  {LF
Karsten Hopp 9681ca
+ search()
Karsten Hopp 9681ca
+ 0
Karsten Hopp 9681ca
+ 1
Karsten Hopp 9681ca
+ 1
Karsten Hopp 9681ca
*** ../vim-7.3.870/src/version.c	2013-03-19 14:48:25.000000000 +0100
Karsten Hopp 9681ca
--- src/version.c	2013-03-19 15:26:38.000000000 +0100
Karsten Hopp 9681ca
***************
Karsten Hopp 9681ca
*** 730,731 ****
Karsten Hopp 9681ca
--- 730,733 ----
Karsten Hopp 9681ca
  {   /* Add new patch number below this line */
Karsten Hopp 9681ca
+ /**/
Karsten Hopp 9681ca
+     871,
Karsten Hopp 9681ca
  /**/
Karsten Hopp 9681ca
Karsten Hopp 9681ca
-- 
Karsten Hopp 9681ca
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 9681ca
75. You start wondering whether you could actually upgrade your brain
Karsten Hopp 9681ca
    with a Pentium Pro microprocessor 80.  The upgrade works just fine.
Karsten Hopp 9681ca
Karsten Hopp 9681ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 9681ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 9681ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 9681ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///