]> granicus.if.org Git - vim/commitdiff
patch 8.1.1328: no test for listener with undo operation v8.1.1328
authorBram Moolenaar <Bram@vim.org>
Sun, 12 May 2019 12:36:27 +0000 (14:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 May 2019 12:36:27 +0000 (14:36 +0200)
Problem:    No test for listener with undo operation.
Solution:   Add a test.

src/testdir/test_listener.vim
src/version.c

index d0e4366a20f157c9a2b8d112ad304ab29a2d1ef2..26cf2d319356bb7bafbad802a3b91eea32e79fb5 100644 (file)
@@ -21,6 +21,15 @@ func Test_listening()
   redraw
   call assert_equal([{'lnum': 1, 'end': 2, 'col': 1, 'added': 0}], s:list)
 
+  " Undo is also a change
+  set undolevels&  " start new undo block
+  call append(2, 'two two')
+  undo
+  redraw
+  call assert_equal([{'lnum': 3, 'end': 3, 'col': 1, 'added': 1},
+       \ {'lnum': 3, 'end': 4, 'col': 1, 'added': -1}, ], s:list)
+  1
+
   " Two listeners, both get called.
   let id2 = listener_add({l -> s:AnotherStoreList(l)})
   let s:list = []
index d45484fed1e1475f9cf85f432c56c9d7124a5efd..74dba7cae6df0d45781085491cd27123225ae0b2 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1328,
 /**/
     1327,
 /**/