From b441dafdf53e367c7d43177274bd781c5c73e6e0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 4 May 2023 16:46:38 +0800 Subject: vim-patch:8.2.2344: using inclusive index for slice is not always desired Problem: Using inclusive index for slice is not always desired. Solution: Add the slice() method, which has an exclusive index. (closes vim/vim#7408) https://github.com/vim/vim/commit/6601b62943a19d4f8818c3638440663d67a17b6a Cherry-pick a line in docs added later. Co-authored-by: Bram Moolenaar --- test/old/testdir/test_visual.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/old/testdir/test_visual.vim b/test/old/testdir/test_visual.vim index d10a946200..04282416bb 100644 --- a/test/old/testdir/test_visual.vim +++ b/test/old/testdir/test_visual.vim @@ -935,7 +935,7 @@ func Test_visual_block_mode() endfunc func Test_visual_force_motion_feedkeys() - onoremap i- execute('let g:mode = mode(1)') + onoremap i- execute('let g:mode = mode(1)')->slice(0, 0) call feedkeys('dvi-', 'x') call assert_equal('nov', g:mode) call feedkeys('di-', 'x') -- cgit