diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-26 23:25:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-26 23:25:37 +0800 |
commit | ed58580dfe51faba6a35adb43322e0991e48e4c6 (patch) | |
tree | 02d426b284c36d86d34277fde62ceede99545044 /src/nvim/testdir | |
parent | 48990a7077bb6767f3d218907344ee7fb0bfaaff (diff) | |
parent | 6644742c26e4d8da999cf00754b6e6ee0ba0618f (diff) | |
download | rneovim-ed58580dfe51faba6a35adb43322e0991e48e4c6.tar.gz rneovim-ed58580dfe51faba6a35adb43322e0991e48e4c6.tar.bz2 rneovim-ed58580dfe51faba6a35adb43322e0991e48e4c6.zip |
Merge pull request #22411 from zeertzjq/vim-9.0.1354
vim-patch:9.0.{1354,1356}: "gr CTRL-G" stays in virtual replace mode
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_edit.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_normal.vim | 23 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 89a9179e60..b6078a1e22 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -580,6 +580,7 @@ func Test_edit_CTRL_G() call assert_equal([0, 3, 7, 0], getpos('.')) call feedkeys("i\<c-g>j\<esc>", 'tnix') call assert_equal([0, 3, 6, 0], getpos('.')) + call assert_nobeep("normal! i\<c-g>\<esc>") bw! endfunc diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index 390e179f13..5d8e1913a2 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -3283,9 +3283,9 @@ func Test_delete_until_paragraph() endfunc " Test for the gr (virtual replace) command -" Test for the bug fixed by 7.4.387 func Test_gr_command() enew! + " Test for the bug fixed by 7.4.387 let save_cpo = &cpo call append(0, ['First line', 'Second line', 'Third line']) exe "normal i\<C-G>u" @@ -3298,10 +3298,12 @@ func Test_gr_command() normal 4gro call assert_equal('ooooecond line', getline(2)) let &cpo = save_cpo + normal! ggvegrx call assert_equal('xxxxx line', getline(1)) exe "normal! gggr\<C-V>122" call assert_equal('zxxxx line', getline(1)) + set virtualedit=all normal! 15|grl call assert_equal('zxxxx line l', getline(1)) @@ -3309,8 +3311,25 @@ func Test_gr_command() set nomodifiable call assert_fails('normal! grx', 'E21:') call assert_fails('normal! gRx', 'E21:') + call assert_nobeep("normal! gr\<Esc>") set modifiable& - enew! + + call assert_nobeep("normal! gr\<Esc>") + call assert_beeps("normal! cgr\<Esc>") + + call assert_equal('zxxxx line l', getline(1)) + exe "normal! 2|gr\<C-V>\<Esc>" + call assert_equal("z\<Esc>xx line l", getline(1)) + + call setline(1, 'abcdef') + exe "normal! 0gr\<C-O>lx" + call assert_equal("\<C-O>def", getline(1)) + + call setline(1, 'abcdef') + exe "normal! 0gr\<C-G>lx" + call assert_equal("\<C-G>def", getline(1)) + + bwipe! endfunc func Test_nv_hat_count() |