Patch 8.0.1417
Problem:    Test doesn't search for a sentence. Still fails when searching for
            start of sentence. (Dominique Pelle)
Solution:   Add paren. Check for MAXCOL in dec().
Files:      src/testdir/test_search.vim, src/misc2.c


*** ../vim-8.0.1416/src/testdir/test_search.vim 2017-12-19 21:23:16.813960405 
+0100
--- src/testdir/test_search.vim 2017-12-19 22:19:33.120208599 +0100
***************
*** 733,738 ****
  func Test_search_sentence()
    new
    " this used to cause a crash
!   call assert_fails("/\\%'", 'E486')
    call assert_fails("/", 'E486')
  endfunc
--- 733,740 ----
  func Test_search_sentence()
    new
    " this used to cause a crash
!   call assert_fails("/\\%')", 'E486')
    call assert_fails("/", 'E486')
+   /\%'(
+   /
  endfunc
*** ../vim-8.0.1416/src/misc2.c 2017-12-19 21:23:16.813960405 +0100
--- src/misc2.c 2017-12-19 22:17:24.340515172 +0100
***************
*** 417,424 ****
  #ifdef FEAT_VIRTUALEDIT
      lp->coladd = 0;
  #endif
!     if (lp->col > 0)          /* still within line */
      {
        lp->col--;
  #ifdef FEAT_MBYTE
        if (has_mbyte)
--- 417,437 ----
  #ifdef FEAT_VIRTUALEDIT
      lp->coladd = 0;
  #endif
!     if (lp->col == MAXCOL)
      {
+       /* past end of line */
+       p = ml_get(lp->lnum);
+       lp->col = (colnr_T)STRLEN(p);
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           lp->col -= (*mb_head_off)(p, p + lp->col);
+ #endif
+       return 0;
+     }
+ 
+     if (lp->col > 0)
+     {
+       /* still within line */
        lp->col--;
  #ifdef FEAT_MBYTE
        if (has_mbyte)
***************
*** 429,436 ****
  #endif
        return 0;
      }
!     if (lp->lnum > 1)         /* there is a prior line */
      {
        lp->lnum--;
        p = ml_get(lp->lnum);
        lp->col = (colnr_T)STRLEN(p);
--- 442,451 ----
  #endif
        return 0;
      }
! 
!     if (lp->lnum > 1)
      {
+       /* there is a prior line */
        lp->lnum--;
        p = ml_get(lp->lnum);
        lp->col = (colnr_T)STRLEN(p);
***************
*** 440,446 ****
  #endif
        return 1;
      }
!     return -1;                        /* at start of file */
  }
  
  /*
--- 455,463 ----
  #endif
        return 1;
      }
! 
!     /* at start of file */
!     return -1;
  }
  
  /*
*** ../vim-8.0.1416/src/version.c       2017-12-19 21:23:16.817960377 +0100
--- src/version.c       2017-12-19 22:20:41.476014877 +0100
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1417,
  /**/

-- 
"The sun oozed over the horizon, shoved aside darkness, crept along the
greensward, and, with sickly fingers, pushed through the castle window,
revealing the pillaged princess, hand at throat, crown asunder, gaping
in frenzied horror at the sated, sodden amphibian lying beside her,
disbelieving the magnitude of the frog's deception, screaming madly,
"You lied!"
    - Winner of the Bulwer-Lytton contest (San Jose State University),
      wherein one writes only the first line of a bad novel

 /// 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/d/optout.

Raspunde prin e-mail lui