changeset 25858:fc39d7352cb6 v8.2.3463

patch 8.2.3463: pattern matching with ModeChanged not tested Commit: https://github.com/vim/vim/commit/72d2fa69e56dd0e61eac87a9c3b79cd89d47cdd9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 2 21:48:15 2021 +0100 patch 8.2.3463: pattern matching with ModeChanged not tested Problem: Pattern matching with ModeChanged not tested. Solution: Add a few more test lines. (issue https://github.com/vim/vim/issues/8856)
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 Oct 2021 23:00:03 +0200
parents 03c061ca9855
children 5123e0f4ce75
files src/testdir/test_edit.vim src/version.c
diffstat 2 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1932,10 +1932,31 @@ func Test_mode_changes()
   call assert_equal(4, g:count)
   call assert_equal(len(g:mode_seq) - 1, g:index)
 
+  let g:n_to_i = 0
+  au ModeChanged n:i let g:n_to_i += 1
+  let g:n_to_niI = 0
+  au ModeChanged i:niI let g:n_to_niI += 1
+  let g:niI_to_i = 0
+  au ModeChanged niI:i let g:niI_to_i += 1
+  let g:nany_to_i = 0
+  au ModeChanged n*:i let g:nany_to_i += 1
+  let g:i_to_n = 0
+  au ModeChanged i:n let g:i_to_n += 1
+  let g:nori_to_any = 0
+  au ModeChanged [ni]:* let g:nori_to_any += 1
+  let g:i_to_any = 0
+  au ModeChanged i:* let g:i_to_any += 1
   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)
+  call assert_equal(1, g:n_to_i)
+  call assert_equal(1, g:n_to_niI)
+  call assert_equal(1, g:niI_to_i)
+  call assert_equal(2, g:nany_to_i)
+  call assert_equal(1, g:i_to_n)
+  call assert_equal(2, g:i_to_any)
+  call assert_equal(3, g:nori_to_any)
 
   au! ModeChanged
   delfunc TestMode
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3463,
+/**/
     3462,
 /**/
     3461,