From 08d5b4275ecaae4d3329d4ed2469782f10dd463e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 11 Jan 2023 06:39:20 +0800 Subject: vim-patch:9.0.1172: when 'selection' is "exclusive" then "1v" is one char short (#21735) Problem: When 'selection' is "exclusive" then "1v" is one char short. Solution: Add one character when 'selection' is "exclusive. (closes vim/vim#11791) https://github.com/vim/vim/commit/79c11e399be3d96ed6d1c7458b1380e878ec717b Cherry-pick update_curswant_force() refactor from patch 9.0.0482. Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_visual.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index 712ea343ed..14d62089cf 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -1338,6 +1338,18 @@ func Test_visual_reselect_with_count() call delete('XvisualReselect') endfunc +func Test_visual_reselect_exclusive() + new + call setline(1, ['abcde', 'abcde']) + set selection=exclusive + normal 1G0viwd + normal 2G01vd + call assert_equal(['', ''], getline(1, 2)) + + set selection& + bwipe! +endfunc + func Test_visual_block_insert_round_off() new " The number of characters are tuned to fill a 4096 byte allocated block, -- cgit