forked from aniani/vim
updated for version 7.3.776
Problem: ml_get error when searching, caused by curwin not matching curbuf. Solution: Avoid changing curbuf. (Lech Lorens)
This commit is contained in:
14
src/regexp.c
14
src/regexp.c
@@ -3623,7 +3623,6 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
|
||||
proftime_T *tm; /* timeout limit or NULL */
|
||||
{
|
||||
long r;
|
||||
buf_T *save_curbuf = curbuf;
|
||||
|
||||
reg_match = NULL;
|
||||
reg_mmatch = rmp;
|
||||
@@ -3638,10 +3637,7 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
|
||||
#endif
|
||||
ireg_maxcol = rmp->rmm_maxcol;
|
||||
|
||||
/* Need to switch to buffer "buf" to make vim_iswordc() work. */
|
||||
curbuf = buf;
|
||||
r = vim_regexec_both(NULL, col, tm);
|
||||
curbuf = save_curbuf;
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -4185,7 +4181,7 @@ regmatch(scan)
|
||||
int cmp = OPERAND(scan)[1];
|
||||
pos_T *pos;
|
||||
|
||||
pos = getmark(mark, FALSE);
|
||||
pos = getmark_buf(reg_buf, mark, FALSE);
|
||||
if (pos == NULL /* mark doesn't exist */
|
||||
|| pos->lnum <= 0 /* mark isn't set (in curbuf) */
|
||||
|| (pos->lnum == reglnum + reg_firstlnum
|
||||
@@ -4315,8 +4311,8 @@ regmatch(scan)
|
||||
#endif
|
||||
else
|
||||
{
|
||||
if (!vim_iswordc(c)
|
||||
|| (reginput > regline && vim_iswordc(reginput[-1])))
|
||||
if (!vim_iswordc_buf(c, reg_buf)
|
||||
|| (reginput > regline && vim_iswordc_buf(reginput[-1], reg_buf)))
|
||||
status = RA_NOMATCH;
|
||||
}
|
||||
break;
|
||||
@@ -4339,8 +4335,8 @@ regmatch(scan)
|
||||
#endif
|
||||
else
|
||||
{
|
||||
if (!vim_iswordc(reginput[-1])
|
||||
|| (reginput[0] != NUL && vim_iswordc(c)))
|
||||
if (!vim_iswordc_buf(reginput[-1], reg_buf)
|
||||
|| (reginput[0] != NUL && vim_iswordc_buf(c, reg_buf)))
|
||||
status = RA_NOMATCH;
|
||||
}
|
||||
break; /* Matched with EOW */
|
||||
|
Reference in New Issue
Block a user