summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-01-23 16:43:11 +0100
committerBram Moolenaar <Bram@vim.org>2013-01-23 16:43:11 +0100
commit55b7b7eeb50d4fab541ba151e0f653eb6e3852b8 (patch)
tree076523b734fbd657f323c8fb5923433c98949032 /src/search.c
parent94a8adfdd890f0550f81755b247ca7cc5336ad20 (diff)
downloadvim-55b7b7eeb50d4fab541ba151e0f653eb6e3852b8.zip
updated for version 7.3.779
Problem: Backwards search lands in wrong place when started on a multibyte character. Solution: Do not set extra_col for a backwards search. (Sung Pae)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 0b1c519fb..24b0c4a82 100644
--- a/src/search.c
+++ b/src/search.c
@@ -572,7 +572,8 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
extra_col = 0;
#ifdef FEAT_MBYTE
/* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
- else if (has_mbyte && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
+ else if (dir != BACKWARD && has_mbyte
+ && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
&& pos->col < MAXCOL - 2)
{
ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;