]> granicus.if.org Git - vim/commitdiff
patch 7.4.929 v7.4.929
authorBram Moolenaar <Bram@vim.org>
Thu, 19 Nov 2015 19:11:54 +0000 (20:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 19 Nov 2015 19:11:54 +0000 (20:11 +0100)
Problem:    "gv" after paste selects one character less if 'selection' is
            "exclusive".
Solution:   Increment the end position. (Christian Brabandt)

src/normal.c
src/testdir/test94.in
src/testdir/test94.ok
src/version.c

index b994056e653486e22815a456e5214dee35cbb2bd..b9170ace5508dfe3b974a8a737643e3b0f32032a 100644 (file)
@@ -9496,6 +9496,9 @@ nv_put(cap)
        {
            curbuf->b_visual.vi_start = curbuf->b_op_start;
            curbuf->b_visual.vi_end = curbuf->b_op_end;
+           /* need to adjust cursor position */
+           if (*p_sel == 'e')
+               inc(&curbuf->b_visual.vi_end);
        }
 
        /* When all lines were selected and deleted do_put() leaves an empty
index 287d9dc9c149cd9aa1c10da35ed58b645d3ed29b..aa86fc1df9543f292c08520858a76cb0fb5d3310 100644 (file)
@@ -210,6 +210,21 @@ $vp
 :-2yank
 $v$p
 :$put ='---'
+:
+:$put =''
+:$put ='gv in exclusive select mode after operation'
+:$put ='zzz '
+:$put ='äà'
+:set selection=exclusive
+kv3lyjv3lpgvcxxx\e
+:$put ='---'
+:
+:$put =''
+:$put ='gv in exclusive select mode without operation'
+:$put ='zzz '
+:set selection=exclusive
+0v3l\egvcxxx\e
+:$put ='---'
 :/^start:/+2,$w! test.out
 :q!
 ENDTEST
index a1b037813f8d73352232fa0a014fbdc43363bfb5..c0239221775622ac94b9f273a2d866fd861df708 100644 (file)
@@ -112,3 +112,12 @@ cc
 aaa
 
 ---
+
+gv in exclusive select mode after operation
+zzz 
+xxx 
+---
+
+gv in exclusive select mode without operation
+xxx 
+---
index 77a2564481f8037a73460380617260a7fe0f980c..fc286b828f769c8cd8844d644eb6cad6207fac7b 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    929,
 /**/
     928,
 /**/