@@ -28,9 +28,10 @@ func Test_listening()
2828 set undolevels & " start new undo block
2929 call append (2 , ' two two' )
3030 undo
31+ call assert_equal ([{' lnum' : 3 , ' end' : 3 , ' col' : 1 , ' added' : 1 }], s: list )
3132 redraw
32- " the two changes get merged
33- call assert_equal ([{' lnum' : 3 , ' end' : 4 , ' col' : 1 , ' added' : 0 }], s: list )
33+ " the two changes are not merged
34+ call assert_equal ([{' lnum' : 3 , ' end' : 4 , ' col' : 1 , ' added' : -1 }], s: list )
3435 1
3536
3637 " Two listeners, both get called. Also check column.
@@ -65,15 +66,16 @@ func Test_listening()
6566 call assert_equal ([{' lnum' : 3 , ' end' : 3 , ' col' : 1 , ' added' : 1 },
6667 \ {' lnum' : 1 , ' end' : 2 , ' col' : 1 , ' added' : 0 }], s: list )
6768
68- " an insert just above a previous change that was the last one gets merged
69+ " an insert just above a previous change that was the last one does not get
70+ " merged
6971 call setline (1 , [' one one' , ' two' ])
7072 call listener_flush ()
7173 let s: list = []
7274 call setline (2 , ' something' )
7375 call append (1 , ' two two' )
74- call assert_equal ([], s: list )
76+ call assert_equal ([{ ' lnum ' : 2 , ' end ' : 3 , ' col ' : 1 , ' added ' : 0 } ], s: list )
7577 call listener_flush ()
76- call assert_equal ([{' lnum' : 2 , ' end' : 3 , ' col' : 1 , ' added' : 1 }], s: list )
78+ call assert_equal ([{' lnum' : 2 , ' end' : 2 , ' col' : 1 , ' added' : 1 }], s: list )
7779
7880 " an insert above a previous change causes a flush
7981 call setline (1 , [' one one' , ' two' ])
@@ -86,13 +88,13 @@ func Test_listening()
8688 call assert_equal ([{' lnum' : 1 , ' end' : 1 , ' col' : 1 , ' added' : 1 }], s: list )
8789 call assert_equal (' two two' , s: text )
8890
89- " a delete at a previous change that was the last one gets merged
91+ " a delete at a previous change that was the last one does not get merged
9092 call setline (1 , [' one one' , ' two' ])
9193 call listener_flush ()
9294 let s: list = []
9395 call setline (2 , ' something' )
9496 2 del
95- call assert_equal ([], s: list )
97+ call assert_equal ([{ ' lnum ' : 2 , ' end ' : 3 , ' col ' : 1 , ' added ' : 0 } ], s: list )
9698 call listener_flush ()
9799 call assert_equal ([{' lnum' : 2 , ' end' : 3 , ' col' : 1 , ' added' : -1 }], s: list )
98100
0 commit comments