1
0
forked from aniani/vim

patch 8.1.1328: no test for listener with undo operation

Problem:    No test for listener with undo operation.
Solution:   Add a test.
This commit is contained in:
Bram Moolenaar
2019-05-12 14:36:27 +02:00
parent a9b2535f44
commit bc4fd43160
2 changed files with 11 additions and 0 deletions

View File

@@ -21,6 +21,15 @@ func Test_listening()
redraw redraw
call assert_equal([{'lnum': 1, 'end': 2, 'col': 1, 'added': 0}], s:list) 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. " Two listeners, both get called.
let id2 = listener_add({l -> s:AnotherStoreList(l)}) let id2 = listener_add({l -> s:AnotherStoreList(l)})
let s:list = [] let s:list = []

View File

@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1328,
/**/ /**/
1327, 1327,
/**/ /**/