mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix #528 remove and restore highlights when buffers are hidden and shown
This commit is contained in:
@@ -91,3 +91,19 @@ Execute(Highlights set by ALE should be removed when buffer cleanup is done):
|
||||
call ale#cleanup#Buffer(bufnr('%'))
|
||||
|
||||
AssertEqual [], getmatches()
|
||||
|
||||
Execute(Highlights should be cleared when buffers are hidden):
|
||||
call ale#engine#InitBufferInfo(bufnr('%'))
|
||||
call ale#highlight#SetHighlights(bufnr('%'), [
|
||||
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
|
||||
\])
|
||||
|
||||
AssertEqual 1, len(getmatches()), 'The highlights weren''t initially set!'
|
||||
|
||||
call ale#highlight#BufferHidden(bufnr('%'))
|
||||
|
||||
AssertEqual 0, len(getmatches()), 'The highlights weren''t cleared!'
|
||||
|
||||
call ale#highlight#UpdateHighlights()
|
||||
|
||||
AssertEqual 1, len(getmatches()), 'The highlights weren''t set again!'
|
||||
|
||||
Reference in New Issue
Block a user