diff src/testdir/test_listener.vim @ 16652:b8fda384605b v8.1.1328

patch 8.1.1328: no test for listener with undo operation commit https://github.com/vim/vim/commit/bc4fd43160739efb93c39589dcc9ffd5d5a951d0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 12 14:36:27 2019 +0200 patch 8.1.1328: no test for listener with undo operation Problem: No test for listener with undo operation. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 May 2019 14:45:04 +0200
parents a7f06505ad39
children 04c2614af21c
line wrap: on
line diff
--- a/src/testdir/test_listener.vim
+++ b/src/testdir/test_listener.vim
@@ -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 = []