changeset 3831:ca1c025079b1 v7.3.673

updated for version 7.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)
author Bram Moolenaar <bram@vim.org>
date Wed, 03 Oct 2012 13:35:51 +0200
parents 04592728474a
children 47036f674d53
files src/search.c src/version.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/src/version.c
+++ b/src/version.c
@@ -720,6 +720,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    673,
+/**/
     672,
 /**/
     671,