mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test(old): cherry-pick test_visual changes from v8.2.0369
1671f44881
Omit Test_AAA_start_visual_mode_with_count comment change as it hasn't been
ported yet.
This commit is contained in:
parent
758d7726df
commit
abf42b7ec6
@ -132,11 +132,16 @@ func Test_blockwise_visual_o_O()
|
|||||||
exe "norm! gvO\<Esc>rb"
|
exe "norm! gvO\<Esc>rb"
|
||||||
exe "norm! gvo\<C-c>rc"
|
exe "norm! gvo\<C-c>rc"
|
||||||
exe "norm! gvO\<C-c>rd"
|
exe "norm! gvO\<C-c>rd"
|
||||||
|
set selection=exclusive
|
||||||
|
exe "norm! gvOo\<C-c>re"
|
||||||
|
call assert_equal('...a be.', getline(4))
|
||||||
|
exe "norm! gvOO\<C-c>rf"
|
||||||
|
set selection&
|
||||||
|
|
||||||
call assert_equal(['..........',
|
call assert_equal(['..........',
|
||||||
\ '...c d..',
|
\ '...c d..',
|
||||||
\ '... ..',
|
\ '... ..',
|
||||||
\ '...a b..',
|
\ '...a bf.',
|
||||||
\ '..........'], getline(1, '$'))
|
\ '..........'], getline(1, '$'))
|
||||||
|
|
||||||
enew!
|
enew!
|
||||||
@ -658,6 +663,16 @@ func Test_characterwise_select_mode()
|
|||||||
exe "normal Gkgh\<Down>\<End>\<Del>"
|
exe "normal Gkgh\<Down>\<End>\<Del>"
|
||||||
call assert_equal(['', 'a', ''], getline(1, '$'))
|
call assert_equal(['', 'a', ''], getline(1, '$'))
|
||||||
|
|
||||||
|
" CTRL-H in select mode behaves like 'x'
|
||||||
|
call setline(1, 'abcdef')
|
||||||
|
exe "normal! gggh\<Right>\<Right>\<Right>\<C-H>"
|
||||||
|
call assert_equal('ef', getline(1))
|
||||||
|
|
||||||
|
" CTRL-O in select mode switches to visual mode for one command
|
||||||
|
call setline(1, 'abcdef')
|
||||||
|
exe "normal! gggh\<C-O>3lm"
|
||||||
|
call assert_equal('mef', getline(1))
|
||||||
|
|
||||||
sunmap <lt>End>
|
sunmap <lt>End>
|
||||||
sunmap <lt>Down>
|
sunmap <lt>Down>
|
||||||
sunmap <lt>Del>
|
sunmap <lt>Del>
|
||||||
@ -757,8 +772,7 @@ endfunc
|
|||||||
func Test_visual_block_mode()
|
func Test_visual_block_mode()
|
||||||
new
|
new
|
||||||
call append(0, '')
|
call append(0, '')
|
||||||
call setline(1, ['abcdefghijklm', 'abcdefghijklm', 'abcdefghijklm',
|
call setline(1, repeat(['abcdefghijklm'], 5))
|
||||||
\ 'abcdefghijklm', 'abcdefghijklm'])
|
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
|
|
||||||
" Test shift-right of a block
|
" Test shift-right of a block
|
||||||
@ -777,6 +791,16 @@ func Test_visual_block_mode()
|
|||||||
\ 'axyzqqqqefgmnoklm',
|
\ 'axyzqqqqefgmnoklm',
|
||||||
\ 'abcdqqqqijklm'], getline(1, 5))
|
\ 'abcdqqqqijklm'], getline(1, 5))
|
||||||
|
|
||||||
|
" Test 'C' to change till the end of the line
|
||||||
|
call cursor(3, 4)
|
||||||
|
exe "normal! \<C-V>j3lCooo"
|
||||||
|
call assert_equal(['axyooo', 'axyooo'], getline(3, 4))
|
||||||
|
|
||||||
|
" Test 'D' to delete till the end of the line
|
||||||
|
call cursor(3, 3)
|
||||||
|
exe "normal! \<C-V>j2lD"
|
||||||
|
call assert_equal(['ax', 'ax'], getline(3, 4))
|
||||||
|
|
||||||
" Test from ':help v_b_I_example'
|
" Test from ':help v_b_I_example'
|
||||||
%d _
|
%d _
|
||||||
setlocal tabstop=8 shiftwidth=4
|
setlocal tabstop=8 shiftwidth=4
|
||||||
|
Loading…
Reference in New Issue
Block a user