vim-patch:7.4.929

Problem:    "gv" after paste selects one character less if 'selection' is
            "exclusive".
Solution:   Increment the end position. (Christian Brabandt)

d29c6fea94
This commit is contained in:
watiko
2016-02-07 13:14:43 +09:00
parent 663e1ed158
commit 51c3e0aa80
3 changed files with 29 additions and 1 deletions

View File

@@ -7745,6 +7745,10 @@ static void nv_put(cmdarg_T *cap)
if (was_visual) {
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

View File

@@ -359,7 +359,7 @@ static int included_patches[] = {
// 932,
// 931,
// 930 NA
// 929,
929,
// 928 NA
// 927 NA
// 926,

View File

@@ -371,4 +371,28 @@ describe('Visual mode and operator', function()
]])
end)
end)
it('gv in exclusive select mode after operation', function()
source([[
$put ='zzz '
$put ='äà '
set selection=exclusive]])
feed('kv3lyjv3lpgvcxxx<Esc>')
expect([[
zzz
xxx ]])
end)
it('gv in exclusive select mode without operation', function()
source([[
$put ='zzz '
set selection=exclusive]])
feed('0v3l<Esc>gvcxxx<Esc>')
expect([[
xxx ]])
end)
end)