Skip to content

Commit d29c6fe

Browse files
committed
patch 7.4.929
Problem: "gv" after paste selects one character less if 'selection' is "exclusive". Solution: Increment the end position. (Christian Brabandt)
1 parent 5d8afeb commit d29c6fe

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/normal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9496,6 +9496,9 @@ nv_put(cap)
94969496
{
94979497
curbuf->b_visual.vi_start = curbuf->b_op_start;
94989498
curbuf->b_visual.vi_end = curbuf->b_op_end;
9499+
/* need to adjust cursor position */
9500+
if (*p_sel == 'e')
9501+
inc(&curbuf->b_visual.vi_end);
94999502
}
95009503

95019504
/* When all lines were selected and deleted do_put() leaves an empty

src/testdir/test94.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ $vp
210210
:-2yank
211211
$v$p
212212
:$put ='---'
213+
:
214+
:$put =''
215+
:$put ='gv in exclusive select mode after operation'
216+
:$put ='zzz '
217+
:$put ='äà '
218+
:set selection=exclusive
219+
kv3lyjv3lpgvcxxx
220+
:$put ='---'
221+
:
222+
:$put =''
223+
:$put ='gv in exclusive select mode without operation'
224+
:$put ='zzz '
225+
:set selection=exclusive
226+
0v3lgvcxxx
227+
:$put ='---'
213228
:/^start:/+2,$w! test.out
214229
:q!
215230
ENDTEST

src/testdir/test94.ok

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,12 @@ cc
112112
aaa
113113

114114
---
115+
116+
gv in exclusive select mode after operation
117+
zzz
118+
xxx
119+
---
120+
121+
gv in exclusive select mode without operation
122+
xxx
123+
---

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
929,
744746
/**/
745747
928,
746748
/**/

0 commit comments

Comments
 (0)