aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_visual.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-17 10:04:49 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-15 20:24:42 +0800
commit37586eac42b285b97e6b85e736750c4f15df068d (patch)
treec92ee6407ed9c293f40ce8d296fd6d25e1926e09 /src/nvim/testdir/test_visual.vim
parentd33424983312806fb683eaa6bd720fe418c1299e (diff)
downloadrneovim-37586eac42b285b97e6b85e736750c4f15df068d.tar.gz
rneovim-37586eac42b285b97e6b85e736750c4f15df068d.tar.bz2
rneovim-37586eac42b285b97e6b85e736750c4f15df068d.zip
vim-patch:8.2.1786: various Normal mode commands not fully tested
Problem: Various Normal mode commands not fully tested. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#7059) https://github.com/vim/vim/commit/8a9bc95eaec53f4e0c951ff8f2686ae5113a5709 Cherry-pick Test_normal_gdollar_cmd() change from patch 8.2.0540.
Diffstat (limited to 'src/nvim/testdir/test_visual.vim')
-rw-r--r--src/nvim/testdir/test_visual.vim33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim
index b6a8fb24a4..0a12b3570a 100644
--- a/src/nvim/testdir/test_visual.vim
+++ b/src/nvim/testdir/test_visual.vim
@@ -378,14 +378,17 @@ endfunc
func Test_Visual_paragraph_textobject()
new
- call setline(1, ['First line.',
- \ '',
- \ 'Second line.',
- \ 'Third line.',
- \ 'Fourth line.',
- \ 'Fifth line.',
- \ '',
- \ 'Sixth line.'])
+ let lines =<< trim [END]
+ First line.
+
+ Second line.
+ Third line.
+ Fourth line.
+ Fifth line.
+
+ Sixth line.
+ [END]
+ call setline(1, lines)
" When start and end of visual area are identical, 'ap' or 'ip' select
" the whole paragraph.
@@ -639,6 +642,20 @@ func Test_characterwise_visual_mode()
normal Gkvj$d
call assert_equal(['', 'a', ''], getline(1, '$'))
+ " characterwise visual mode: use a count with the visual mode
+ %d _
+ call setline(1, 'one two three')
+ norm! vy5vy
+ call assert_equal('one t', @")
+
+ " characterwise visual mode: use a count with the visual mode from the last
+ " line in the buffer
+ %d _
+ call setline(1, ['one', 'two', 'three', 'four'])
+ norm! vj$y
+ norm! G1vy
+ call assert_equal('four', @")
+
" characterwise visual mode: replace a single character line and the eol
%d _
call setline(1, "a")