diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-02 16:55:39 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-02 16:55:39 +0100 |
commit | d85931e67316e824878000d0ead122553ccef3a4 (patch) | |
tree | a64477761d5b3916f0d4ac1dd9aee62a70a1f673 /src/testdir/test_edit.vim | |
parent | 72406a4bd2896915b6f541e26d41521a59b1f846 (diff) |
patch 8.2.3462: ModeChanged only uses one character for new_mode and old_modev8.2.3462
Problem: The ModeChanged event only uses one character for the new_mode and
old_mode values.
Solution: Pass one as first argument to mode(). (issue #8856)
Diffstat (limited to 'src/testdir/test_edit.vim')
-rw-r--r-- | src/testdir/test_edit.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 79ba969b1c..20683ef954 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -1918,7 +1918,7 @@ func Test_mode_changes() func! TestMode() call assert_equal(g:mode_seq[g:index], get(v:event, "old_mode")) call assert_equal(g:mode_seq[g:index + 1], get(v:event, "new_mode")) - call assert_equal(mode(), get(v:event, "new_mode")) + call assert_equal(mode(1), get(v:event, "new_mode")) let g:index += 1 endfunc @@ -1930,7 +1930,11 @@ func Test_mode_changes() au ModeChanged V:v :call DoIt() call feedkeys("Vv\<esc>", 'tnix') call assert_equal(4, g:count) + call assert_equal(len(g:mode_seq) - 1, g:index) + let g:index = 0 + let g:mode_seq = ['n', 'i', 'niI', 'i', 'n'] + call feedkeys("a\<C-O>l\<esc>", 'tnix') call assert_equal(len(g:mode_seq) - 1, g:index) au! ModeChanged |