]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.871 v7.3.871
authorBram Moolenaar <Bram@vim.org>
Tue, 19 Mar 2013 14:27:48 +0000 (15:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 19 Mar 2013 14:27:48 +0000 (15:27 +0100)
Problem:    search('^$', 'c') does not use the empty match under the cursor.
Solution:   Special handling of the 'c' flag. (Christian Brabandt)
            Add tests.

src/search.c
src/testdir/test14.in
src/testdir/test14.ok
src/version.c

index fc7468046fb338e0b4c182752765b39f2031316a..934e4b0cff3e2b8db950e8bcaa1d988ad9298a08 100644 (file)
@@ -727,6 +727,8 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
                                        ++matchcol;
                                }
                            }
+                           if (options & SEARCH_START)
+                               break;
                            if (ptr[matchcol] == NUL
                                    || (nmatched = vim_regexec_multi(&regmatch,
                                              win, buf, lnum + matchpos.lnum,
index 05c80257b055c02a21bb2e819c219fdff1702b23..b6f2f57605c8ceae4f63bf81728ba20cac17f8a3 100644 (file)
@@ -2,6 +2,7 @@ Tests for "vaBiB", end could be wrong.
 Also test ":s/pat/sub/" with different ~s in sub.
 Also test for ^Vxff and ^Vo123 in Insert mode.
 Also test "[m", "]m", "[M" and "]M"
+Also test search()
 
 STARTTEST
 :so small.vim
@@ -34,6 +35,16 @@ j2]MaH\e:.w >>test.out
 2[MaJ\e:.w >>test.out
 k[MaK\e:.w >>test.out
 3[MaL\e:.w >>test.out
+:"
+/^foobar
+:let startline = line('.')
+:call search('foobar', 'c')
+:call append(line('$'), line('.') - startline)
+j:call search('^$', 'c')
+:call append(line('$'), line('.') - startline)
+:call search('^$', 'bc')
+:call append(line('$'), line('.') - startline)
+:/^search()/,$w >>test.out
 :qa!
 ENDTEST
 
@@ -64,3 +75,8 @@ Piece of Java
                }
        } e3
 }
+
+foobar
+
+
+search()
index e893ba8034a8416d4cd4623a33947c64fbd4db74..fb795a81ced624d04a35af8c44b2765283d808a4 100644 (file)
@@ -15,3 +15,7 @@ ABC !a\ fg\a8
        }JH e3
        }K e2
 {LF
+search()
+0
+1
+1
index 7705a21f325eb5cf155daa1fcd548655003c3552..1a652acdf9991344396620bcbb308b508630e06e 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    871,
 /**/
     870,
 /**/