summaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-01-23 15:53:15 +0100
committerBram Moolenaar <Bram@vim.org>2013-01-23 15:53:15 +0100
commit9d182dd0a666f7cb706cd54dd78df3f59a160fff (patch)
tree53eb72dd576979b4fdde34e2b0eaff7f972a028f /src/regexp.c
parent4da70dbc4ddef9b2a2815cc0f6f09a283b65e671 (diff)
downloadvim-9d182dd0a666f7cb706cd54dd78df3f59a160fff.zip
updated for version 7.3.776
Problem: ml_get error when searching, caused by curwin not matching curbuf. Solution: Avoid changing curbuf. (Lech Lorens)
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/regexp.c b/src/regexp.c
index b078de385..bb63c942f 100644
--- a/src/regexp.c
+++ b/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 */