comparison src/testdir/test_visual.vim @ 22476:b3751f4d3b26 v8.2.1786

patch 8.2.1786: various Normal mode commands not fully tested Commit: https://github.com/vim/vim/commit/8a9bc95eaec53f4e0c951ff8f2686ae5113a5709 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 2 18:48:07 2020 +0200 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 https://github.com/vim/vim/issues/7059)
author Bram Moolenaar <Bram@vim.org>
date Fri, 02 Oct 2020 19:00:05 +0200
parents 2626306efe44
children 1503ecd54f8a
comparison
equal deleted inserted replaced
22475:dd6a45c54e49 22476:b3751f4d3b26
368 bwipe! 368 bwipe!
369 endfunc 369 endfunc
370 370
371 func Test_Visual_paragraph_textobject() 371 func Test_Visual_paragraph_textobject()
372 new 372 new
373 call setline(1, ['First line.', 373 let lines =<< trim [END]
374 \ '', 374 First line.
375 \ 'Second line.', 375
376 \ 'Third line.', 376 Second line.
377 \ 'Fourth line.', 377 Third line.
378 \ 'Fifth line.', 378 Fourth line.
379 \ '', 379 Fifth line.
380 \ 'Sixth line.']) 380
381 Sixth line.
382 [END]
383 call setline(1, lines)
381 384
382 " When start and end of visual area are identical, 'ap' or 'ip' select 385 " When start and end of visual area are identical, 'ap' or 'ip' select
383 " the whole paragraph. 386 " the whole paragraph.
384 norm! 4ggvapy 387 norm! 4ggvapy
385 call assert_equal("Second line.\nThird line.\nFourth line.\nFifth line.\n\n", @") 388 call assert_equal("Second line.\nThird line.\nFourth line.\nFifth line.\n\n", @")
630 " characterwise visual mode: delete last two lines 633 " characterwise visual mode: delete last two lines
631 call deletebufline('', 1, '$') 634 call deletebufline('', 1, '$')
632 call append('$', ['a', 'b', 'c']) 635 call append('$', ['a', 'b', 'c'])
633 normal Gkvj$d 636 normal Gkvj$d
634 call assert_equal(['', 'a', ''], getline(1, '$')) 637 call assert_equal(['', 'a', ''], getline(1, '$'))
638
639 " characterwise visual mode: use a count with the visual mode
640 %d _
641 call setline(1, 'one two three')
642 norm! vy5vy
643 call assert_equal('one t', @")
644
645 " characterwise visual mode: use a count with the visual mode from the last
646 " line in the buffer
647 %d _
648 call setline(1, ['one', 'two', 'three', 'four'])
649 norm! vj$y
650 norm! G1vy
651 call assert_equal('four', @")
635 652
636 bwipe! 653 bwipe!
637 endfunc 654 endfunc
638 655
639 func Test_visual_mode_put() 656 func Test_visual_mode_put()