#697 - Remove highlights more thoroughly

This commit is contained in:
w0rp
2017-07-13 23:27:02 +01:00
parent b50ae96413
commit 4c6c5bf84f
4 changed files with 69 additions and 93 deletions

View File

@@ -204,3 +204,29 @@ Execute(Highlighting should support errors spanning many lines):
\ },
\ ],
\ GetMatchesWithoutIDs()
\
Execute(Highlights should always be cleared when the buffer highlight list is empty):
" Add our highlights and something else.
call matchaddpos('ALEError', [[1, 1, 1]])
call matchaddpos('SomeOtherGroup', [[1, 1, 1]])
AssertEqual
\ [
\ {'group': 'ALEError', 'priority': 10, 'pos1': [1, 1, 1]},
\ {'group': 'SomeOtherGroup', 'priority': 10, 'pos1': [1, 1, 1]},
\ ],
\ GetMatchesWithoutIDs()
" Set the List we use for holding highlights for buffers.
let b:ale_highlight_items = []
" Call the function for updating the highlights called when buffers
" are entered, or when problems are presented.
call ale#highlight#UpdateHighlights()
" Check that we remove our highlights.
AssertEqual
\ [
\ {'group': 'SomeOtherGroup', 'priority': 10, 'pos1': [1, 1, 1]},
\ ],
\ GetMatchesWithoutIDs()