| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.877 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.877 (after 7.3.871) |
| Problem: Forward searching with search() is broken. |
| Solution: Fix it and add tests. (Sung Pae) |
| Files: src/search.c, src/testdir/test14.in, src/testdir/test14.ok |
| |
| |
| |
| |
| |
| *** 727,733 **** |
| ++matchcol; |
| } |
| } |
| ! if (options & SEARCH_START) |
| break; |
| if (ptr[matchcol] == NUL |
| || (nmatched = vim_regexec_multi(®match, |
| --- 727,733 ---- |
| ++matchcol; |
| } |
| } |
| ! if (matchcol == 0 && (options & SEARCH_START)) |
| break; |
| if (ptr[matchcol] == NUL |
| || (nmatched = vim_regexec_multi(®match, |
| |
| *** 869,875 **** |
| /* With the SEARCH_END option move to the last character |
| * of the match. Don't do it for an empty match, end |
| * should be same as start then. */ |
| ! if (options & SEARCH_END && !(options & SEARCH_NOOF) |
| && !(matchpos.lnum == endpos.lnum |
| && matchpos.col == endpos.col)) |
| { |
| --- 869,875 ---- |
| /* With the SEARCH_END option move to the last character |
| * of the match. Don't do it for an empty match, end |
| * should be same as start then. */ |
| ! if ((options & SEARCH_END) && !(options & SEARCH_NOOF) |
| && !(matchpos.lnum == endpos.lnum |
| && matchpos.col == endpos.col)) |
| { |
| |
| |
| |
| *** 44,49 **** |
| --- 44,52 ---- |
| :call append(line('$'), line('.') - startline) |
| :call search('^$', 'bc') |
| :call append(line('$'), line('.') - startline) |
| + /two |
| + :call search('.', 'c') |
| + :call append(line('$'), getline('.')[col('.') - 1:]) |
| :/^search()/,$w >>test.out |
| :qa! |
| ENDTEST |
| |
| *** 79,82 **** |
| --- 82,86 ---- |
| foobar |
| |
| |
| + one two |
| search() |
| |
| |
| |
| *** 19,21 **** |
| --- 19,22 ---- |
| 0 |
| 1 |
| 1 |
| + two |
| |
| |
| |
| *** 730,731 **** |
| --- 730,733 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 877, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |