From 2476f41a4a4dcf940bce9ea9ae48a6017a35fbc2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 4 Nov 2022 19:49:23 +0800 Subject: vim-patch:8.2.1022: various parts of code not covered by tests Problem: Various parts of code not covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#6300) https://github.com/vim/vim/commit/845e0ee59430eac07e74b6cb92020e420d17953d Omit test_iminsert.vim: the commit that created this file was N/A. Omit test_viminfo.vim: the added tests are N/A. --- src/nvim/testdir/test_virtualedit.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/nvim/testdir/test_virtualedit.vim') diff --git a/src/nvim/testdir/test_virtualedit.vim b/src/nvim/testdir/test_virtualedit.vim index ddc7c20637..edf68e6482 100644 --- a/src/nvim/testdir/test_virtualedit.vim +++ b/src/nvim/testdir/test_virtualedit.vim @@ -357,6 +357,24 @@ func Test_delete_break_tab() close! endfunc +" Test for using , and in virtual edit mode +" to erase character, word and line. +func Test_ve_backspace() + new + call setline(1, 'sample') + set virtualedit=all + set backspace=indent,eol,start + exe "normal 15|i\\" + call assert_equal([0, 1, 7, 5], getpos('.')) + exe "normal 15|i\" + call assert_equal([0, 1, 6, 0], getpos('.')) + exe "normal 15|i\" + call assert_equal([0, 1, 1, 0], getpos('.')) + set backspace& + set virtualedit& + close! +endfunc + " After calling s:TryVirtualeditReplace(), line 1 will contain one of these " two strings, depending on whether virtual editing is on or off. let s:result_ve_on = 'a x' -- cgit