diff options
| author | Pierre <pierre87@users.noreply.github.com> | 2019-03-03 11:04:32 +0100 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-03 11:04:32 +0100 |
| commit | 14c53e4cbede164fb7bbfc948625a769dfb1fa64 (patch) | |
| tree | 782432aaf69654295ed428160f637ff351916c9b /src/nvim/testdir/test_textobjects.vim | |
| parent | 7a6da502b9d8deecfc89d1497a8e8da15e65f31e (diff) | |
| download | rneovim-14c53e4cbede164fb7bbfc948625a769dfb1fa64.tar.gz rneovim-14c53e4cbede164fb7bbfc948625a769dfb1fa64.tar.bz2 rneovim-14c53e4cbede164fb7bbfc948625a769dfb1fa64.zip | |
vim-patch:8.1.0971: failure to select quoted text obj moves cursor #9658
closes #9640
Problem: Failure for selecting quoted text object moves cursor.
Solution: Restore the Visual selection on failure. (Christian Brabandt,
closes vim/vim#4024)
https://github.com/vim/vim/commit/55d3bdbbe2bfc7a78b4aa17763788dbddf87cab0
Diffstat (limited to 'src/nvim/testdir/test_textobjects.vim')
| -rw-r--r-- | src/nvim/testdir/test_textobjects.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textobjects.vim b/src/nvim/testdir/test_textobjects.vim index 6a2f5044cc..9194e0014d 100644 --- a/src/nvim/testdir/test_textobjects.vim +++ b/src/nvim/testdir/test_textobjects.vim @@ -52,6 +52,31 @@ func Test_quote_selection_selection_exclusive() bw! endfunc +func Test_quote_selection_selection_exclusive_abort() + new + set selection=exclusive + call setline(1, "'abzzc'") + let exp_curs = [0, 1, 6, 0] + call cursor(1,1) + exe 'norm! fcdvi"' + " make sure to end visual mode to have a clear state + exe "norm! \<esc>" + call assert_equal(exp_curs, getpos('.')) + call cursor(1,1) + exe 'norm! fcvi"' + exe "norm! \<esc>" + call assert_equal(exp_curs, getpos('.')) + call cursor(1,2) + exe 'norm! vfcoi"' + exe "norm! \<esc>" + let exp_curs = [0, 1, 2, 0] + let exp_visu = [0, 1, 7, 0] + call assert_equal(exp_curs, getpos('.')) + call assert_equal(exp_visu, getpos("'>")) + set selection&vim + bw! +endfunc + " Tests for string and html text objects func Test_string_html_objects() enew! |