diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-04 20:41:53 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-04 20:54:50 +0800 |
| commit | 2aafaa59928e17fd7858a89d203e2b2a07707601 (patch) | |
| tree | 30ee4255289a1c3be9a7a80ab06242ec91908406 /src/nvim/testdir/test_virtualedit.vim | |
| parent | 26a9f786c41bc8fa383e3ffe55a1fe77b50fb320 (diff) | |
| download | rneovim-2aafaa59928e17fd7858a89d203e2b2a07707601.tar.gz rneovim-2aafaa59928e17fd7858a89d203e2b2a07707601.tar.bz2 rneovim-2aafaa59928e17fd7858a89d203e2b2a07707601.zip | |
vim-patch:8.2.2901: some operators not fully tested
Problem: Some operators not fully tested.
Solution: Add a few test cases. (Yegappan Lakshmanan, closes vim/vim#8282)
https://github.com/vim/vim/commit/3e72dcad8b752a42b6eaf71213e3f5d534175256
Diffstat (limited to 'src/nvim/testdir/test_virtualedit.vim')
| -rw-r--r-- | src/nvim/testdir/test_virtualedit.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_virtualedit.vim b/src/nvim/testdir/test_virtualedit.vim index edf68e6482..2bf8c3fc77 100644 --- a/src/nvim/testdir/test_virtualedit.vim +++ b/src/nvim/testdir/test_virtualedit.vim @@ -80,6 +80,10 @@ func Test_edit_change() call setline(1, "\t⒌") normal Cx call assert_equal('x', getline(1)) + " Do a visual block change + call setline(1, ['a', 'b', 'c']) + exe "normal gg3l\<C-V>2jcx" + call assert_equal(['a x', 'b x', 'c x'], getline(1, '$')) bwipe! set virtualedit= endfunc @@ -289,6 +293,16 @@ func Test_replace_after_eol() call append(0, '"r"') normal gg$5lrxa call assert_equal('"r" x', getline(1)) + " visual block replace + %d _ + call setline(1, ['a', '', 'b']) + exe "normal 2l\<C-V>2jrx" + call assert_equal(['a x', ' x', 'b x'], getline(1, '$')) + " visual characterwise selection replace after eol + %d _ + call setline(1, 'a') + normal 4lv2lrx + call assert_equal('a xxx', getline(1)) bwipe! set virtualedit= endfunc @@ -375,6 +389,19 @@ func Test_ve_backspace() close! endfunc +" Test for delete (x) on EOL character and after EOL +func Test_delete_past_eol() + new + call setline(1, "ab") + set virtualedit=all + exe "normal 2lx" + call assert_equal('ab', getline(1)) + exe "normal 10lx" + call assert_equal('ab', getline(1)) + set virtualedit& + bw! +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' |