summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-10-03 13:35:51 +0200
committerBram Moolenaar <Bram@vim.org>2012-10-03 13:35:51 +0200
commit718f007499a5d3f0ff9c0a645780133131ab2b2e (patch)
tree92ec9f2367304ec89f89313825b04e82a76b9ed1 /src/search.c
parentd09acef44bcfa5871d6e9a2eea21c911dfbeef13 (diff)
downloadvim-git-718f007499a5d3f0ff9c0a645780133131ab2b2e.tar.gz
updated for version 7.3.673v7.3.673
Problem: Using "gN" while 'selection' is "exclusive" misses one character. (Ben Fritz) Solution: Check the direction when compensating for exclusive selection. (Christian Brabandt)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c
index 158cfd8f5..d7bfc43b1 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4650,8 +4650,15 @@ current_search(count, forward)
if (VIsual_active)
{
redraw_curbuf_later(INVERTED); /* update the inversion */
- if (*p_sel == 'e' && ltoreq(VIsual, curwin->w_cursor))
- inc_cursor();
+ if (*p_sel == 'e')
+ {
+ /* Correction for exclusive selection depends on the direction. */
+ if (forward && ltoreq(VIsual, curwin->w_cursor))
+ inc_cursor();
+ else if (!forward && ltoreq(curwin->w_cursor, VIsual))
+ inc(&VIsual);
+ }
+
}
#ifdef FEAT_FOLDING