mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
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:
@@ -7745,6 +7745,10 @@ static void nv_put(cmdarg_T *cap)
|
|||||||
if (was_visual) {
|
if (was_visual) {
|
||||||
curbuf->b_visual.vi_start = curbuf->b_op_start;
|
curbuf->b_visual.vi_start = curbuf->b_op_start;
|
||||||
curbuf->b_visual.vi_end = curbuf->b_op_end;
|
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
|
/* When all lines were selected and deleted do_put() leaves an empty
|
||||||
|
@@ -359,7 +359,7 @@ static int included_patches[] = {
|
|||||||
// 932,
|
// 932,
|
||||||
// 931,
|
// 931,
|
||||||
// 930 NA
|
// 930 NA
|
||||||
// 929,
|
929,
|
||||||
// 928 NA
|
// 928 NA
|
||||||
// 927 NA
|
// 927 NA
|
||||||
// 926,
|
// 926,
|
||||||
|
@@ -371,4 +371,28 @@ describe('Visual mode and operator', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
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)
|
end)
|
||||||
|
Reference in New Issue
Block a user