int dir;
int result; /* result of various function calls */
char_u old_p_ws = p_ws;
- int visual_active = FALSE;
int flags = 0;
pos_T save_VIsual;
int zerowidth = FALSE;
{
orig_pos = curwin->w_cursor;
save_VIsual = VIsual;
- visual_active = TRUE;
-
- /* just started visual selection, only one character */
- if (equalpos(VIsual, curwin->w_cursor))
- visual_active = FALSE;
pos = curwin->w_cursor;
start_pos = VIsual;
p_ws = old_p_ws;
return FAIL;
}
- else if (!i && !result && !visual_active)
+ else if (!i && !result)
{
if (forward) /* try again from start of buffer */
{
regmmatch_T regmatch;
int nmatched = 0;
int result = -1;
- pos_T pos;
+ pos_T pos;
+ int save_called_emsg = called_emsg;
if (search_regcomp(pattern, RE_SEARCH, RE_SEARCH,
SEARCH_KEEP, ®match) == FAIL)
{
/* Zero-width pattern should match somewhere, then we can check if
* start and end are in the same position. */
+ called_emsg = FALSE;
nmatched = vim_regexec_multi(®match, curwin, curbuf,
pos.lnum, (colnr_T)0, NULL);
if (!called_emsg)
result = (nmatched != 0
- && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
- && regmatch.startpos[0].col == regmatch.endpos[0].col);
+ && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
+ && regmatch.startpos[0].col == regmatch.endpos[0].col);
}
+ called_emsg |= save_called_emsg;
vim_free(regmatch.regprog);
return result;
}