vim-patch:8.2.3462: ModeChanged only uses one character for new_mode and old_mode

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 vim/vim#8856)
d85931e673
This commit is contained in:
Magnus Groß 2021-10-03 16:15:28 +02:00
parent 69bd1e4e36
commit fc3e5caefd
No known key found for this signature in database
GPG Key ID: 56A1295EB9CA7359

View File

@ -1655,7 +1655,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
@ -1667,7 +1667,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