diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-03-05 21:15:06 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-03-05 21:15:06 +0000 |
commit | f86dea8119f3141e3d2c680219036d1511101f9b (patch) | |
tree | 741993d7ef54fa51f7ea56c8975b56d55cdf8b57 /src/testdir/test_normal.vim | |
parent | b0b6b8b07eaeac5a22370d2b8ecefb6dd026c541 (diff) |
patch 9.0.1385: g'Esc is considered an errorv9.0.1385
Problem: g'Esc is considered an error.
Solution: Make g'Esc silently abandon the command. (closes #12110)
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r-- | src/testdir/test_normal.vim | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 6db5af76ab..7b775fe00f 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -2526,6 +2526,8 @@ func Test_normal33_g_cmd2() norm! g'a call assert_equal('>', a[-1:]) call assert_equal(1, line('.')) + call assert_nobeep("normal! g`\<Esc>") + call assert_nobeep("normal! g'\<Esc>") " Test for g; and g, norm! g; @@ -3305,7 +3307,8 @@ func Test_gr_command() set modifiable& call assert_nobeep("normal! gr\<Esc>") - call assert_beeps("normal! cgr\<Esc>") + call assert_nobeep("normal! cgr\<Esc>") + call assert_beeps("normal! cgrx") call assert_equal('zxxxx line l', getline(1)) exe "normal! 2|gr\<C-V>\<Esc>" @@ -3921,4 +3924,36 @@ func Test_mouse_shape_after_failed_change() call delete('Xmouseshapes') endfunc +" Test that mouse shape is restored to Normal mode after cancelling "gr". +func Test_mouse_shape_after_cancelling_gr() + CheckFeature mouseshape + CheckCanRunGui + + let lines =<< trim END + vim9script + var mouse_shapes = [] + + feedkeys('gr') + timer_start(50, (_) => { + mouse_shapes += [getmouseshape()] + timer_start(50, (_) => { + feedkeys("\<Esc>") + timer_start(50, (_) => { + mouse_shapes += [getmouseshape()] + timer_start(50, (_) => { + writefile(mouse_shapes, 'Xmouseshapes') + quit + }) + }) + }) + }) + END + call writefile(lines, 'Xmouseshape.vim', 'D') + call RunVim([], [], "-g -S Xmouseshape.vim") + sleep 300m + call assert_equal(['beam', 'arrow'], readfile('Xmouseshapes')) + + call delete('Xmouseshapes') +endfunc + " vim: shiftwidth=2 sts=2 expandtab |