Mercurial > vim
diff src/testdir/test_autocmd.vim @ 30908:11115c806541 v9.0.0788
patch 9.0.0788: ModeChanged autocmd not executed when Visual ends with CTRL-C
Commit: https://github.com/vim/vim/commit/61c4b04799bf114cadc3bbf212ae8b2ad22a6980
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 18 15:10:11 2022 +0100
patch 9.0.0788: ModeChanged autocmd not executed when Visual ends with CTRL-C
Problem: ModeChanged autocmd not executed when Visual mode is ended with
CTRL-C.
Solution: Do not trigger the autocmd when got_int is set. (closes #11394)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 18 Oct 2022 16:15:04 +0200 |
parents | ac908e454519 |
children | 6686e742a859 |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -3429,6 +3429,18 @@ func Test_mode_changes() unlet g:n_to_c unlet g:c_to_n + let g:n_to_v = 0 + au ModeChanged n:v let g:n_to_v += 1 + let g:v_to_n = 0 + au ModeChanged v:n let g:v_to_n += 1 + let g:mode_seq += ['v', 'n'] + call feedkeys("v\<C-C>", 'tnix') + call assert_equal(len(g:mode_seq) - 1, g:index) + call assert_equal(1, g:n_to_v) + call assert_equal(1, g:v_to_n) + unlet g:n_to_v + unlet g:v_to_n + au! ModeChanged delfunc TestMode unlet! g:mode_seq