mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.0.1417: test doesn't search for a sentence
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().
This commit is contained in:
parent
8ada6aa929
commit
1bd999f982
23
src/misc2.c
23
src/misc2.c
@ -417,8 +417,21 @@ dec(pos_T *lp)
|
|||||||
#ifdef FEAT_VIRTUALEDIT
|
#ifdef FEAT_VIRTUALEDIT
|
||||||
lp->coladd = 0;
|
lp->coladd = 0;
|
||||||
#endif
|
#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--;
|
lp->col--;
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
@ -429,8 +442,10 @@ dec(pos_T *lp)
|
|||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (lp->lnum > 1) /* there is a prior line */
|
|
||||||
|
if (lp->lnum > 1)
|
||||||
{
|
{
|
||||||
|
/* there is a prior line */
|
||||||
lp->lnum--;
|
lp->lnum--;
|
||||||
p = ml_get(lp->lnum);
|
p = ml_get(lp->lnum);
|
||||||
lp->col = (colnr_T)STRLEN(p);
|
lp->col = (colnr_T)STRLEN(p);
|
||||||
@ -440,7 +455,9 @@ dec(pos_T *lp)
|
|||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return -1; /* at start of file */
|
|
||||||
|
/* at start of file */
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -733,6 +733,8 @@ endfunc
|
|||||||
func Test_search_sentence()
|
func Test_search_sentence()
|
||||||
new
|
new
|
||||||
" this used to cause a crash
|
" this used to cause a crash
|
||||||
call assert_fails("/\\%'", 'E486')
|
call assert_fails("/\\%')", 'E486')
|
||||||
call assert_fails("/", 'E486')
|
call assert_fails("/", 'E486')
|
||||||
|
/\%'(
|
||||||
|
/
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1417,
|
||||||
/**/
|
/**/
|
||||||
1416,
|
1416,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user