Remove error highlights when buffers are cleaned up

This commit is contained in:
w0rp
2017-04-19 22:55:06 +01:00
parent a1932b7ff5
commit 84004665d5
3 changed files with 31 additions and 6 deletions

View File

@@ -74,3 +74,20 @@ Execute(Existing highlights should be kept):
\ {'group': 'ALEWarning', 'id': 8, 'priority': 10, 'pos1': [4, 1, 1]},
\ ],
\ getmatches()
" This test is important for preventing ALE from showing highlights for
" the wrong files.
Execute(Highlights set by ALE should be removed when buffer cleanup is done):
call ale#engine#InitBufferInfo(bufnr('%'))
call ale#highlight#SetHighlights(bufnr('%'), [
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
\])
AssertEqual
\ [{'group': 'ALEError', 'id': 9, 'priority': 10, 'pos1': [3, 2, 1]}],
\ getmatches()
call ale#cleanup#Buffer(bufnr('%'))
AssertEqual [], getmatches()