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


*** ../vim-7.3.876/src/search.c 2013-03-19 15:27:43.000000000 +0100
--- src/search.c        2013-04-03 21:07:11.000000000 +0200
***************
*** 727,733 ****
                                        ++matchcol;
                                }
                            }
!                           if (options & SEARCH_START)
                                break;
                            if (ptr[matchcol] == NUL
                                    || (nmatched = vim_regexec_multi(&regmatch,
--- 727,733 ----
                                        ++matchcol;
                                }
                            }
!                           if (matchcol == 0 && (options & SEARCH_START))
                                break;
                            if (ptr[matchcol] == NUL
                                    || (nmatched = vim_regexec_multi(&regmatch,
***************
*** 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))
                    {
*** ../vim-7.3.876/src/testdir/test14.in        2013-03-19 15:27:43.000000000 
+0100
--- src/testdir/test14.in       2013-04-03 20:59:14.000000000 +0200
***************
*** 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()
*** ../vim-7.3.876/src/testdir/test14.ok        2013-03-19 15:27:43.000000000 
+0100
--- src/testdir/test14.ok       2013-04-03 20:59:14.000000000 +0200
***************
*** 19,21 ****
--- 19,22 ----
  0
  1
  1
+ two
*** ../vim-7.3.876/src/version.c        2013-04-03 21:11:33.000000000 +0200
--- src/version.c       2013-04-03 21:12:50.000000000 +0200
***************
*** 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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui