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().
#ifdef FEAT_VIRTUALEDIT
lp->coladd = 0;
#endif
- if (lp->col > 0) /* still within line */
+ 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)
#endif
return 0;
}
- if (lp->lnum > 1) /* there is a prior line */
+
+ if (lp->lnum > 1)
{
+ /* there is a prior line */
lp->lnum--;
p = ml_get(lp->lnum);
lp->col = (colnr_T)STRLEN(p);
#endif
return 1;
}
- return -1; /* at start of file */
+
+ /* at start of file */
+ return -1;
}
/*
func Test_search_sentence()
new
" this used to cause a crash
- call assert_fails("/\\%'", 'E486')
+ call assert_fails("/\\%')", 'E486')
call assert_fails("/", 'E486')
+ /\%'(
+ /
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1417,
/**/
1416,
/**/