0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0206

This commit is contained in:
Bram Moolenaar
2006-02-24 23:53:04 +00:00
parent 2a3f7eeebf
commit 32466aa2e9
40 changed files with 1091 additions and 480 deletions

View File

@@ -602,7 +602,11 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
# ifdef FEAT_EVAL
submatch = first_submatch(&regmatch);
# endif
ptr = ml_get_buf(buf, lnum + matchpos.lnum, FALSE);
/* Line me be past end of buffer for "\n\zs". */
if (lnum + matchpos.lnum > buf->b_ml.ml_line_count)
ptr = (char_u *)"";
else
ptr = ml_get_buf(buf, lnum + matchpos.lnum, FALSE);
/*
* Forward search in the first line: match should be after
@@ -886,6 +890,15 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
return FAIL;
}
/* A pattern like "\n\zs" may go past the last line. */
if (pos->lnum > buf->b_ml.ml_line_count)
{
pos->lnum = buf->b_ml.ml_line_count;
pos->col = STRLEN(ml_get_buf(buf, pos->lnum, FALSE));
if (pos->col > 0)
--pos->col;
}
return submatch + 1;
}