aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/normal.c4
-rw-r--r--src/nvim/version.c2
-rw-r--r--test/functional/legacy/094_visual_mode_operators_spec.lua24
3 files changed, 29 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 233be6d32d..e6c5354941 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -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
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 4ecfd634a2..bd85b10dd1 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -359,7 +359,7 @@ static int included_patches[] = {
// 932,
// 931,
// 930 NA
- // 929,
+ 929,
// 928 NA
// 927 NA
// 926,
diff --git a/test/functional/legacy/094_visual_mode_operators_spec.lua b/test/functional/legacy/094_visual_mode_operators_spec.lua
index 32ce713a02..4dce39b8d2 100644
--- a/test/functional/legacy/094_visual_mode_operators_spec.lua
+++ b/test/functional/legacy/094_visual_mode_operators_spec.lua
@@ -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)