summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-19 22:55:06 +0100
committerw0rp <devw0rp@gmail.com>2017-04-19 22:55:06 +0100
commitd8dcc56af58d1545cf3a7a9f6160d8ba6ad39923 (patch)
tree8497fcf8f62d8806fa2a5a6600bcb4a7cb8654d7 /test
parent72449d7cb154ec16dee95fac76c487c28f7d48df (diff)
downloadale-d8dcc56af58d1545cf3a7a9f6160d8ba6ad39923.zip
Remove error highlights when buffers are cleaned up
Diffstat (limited to 'test')
-rw-r--r--test/test_highlight_placement.vader17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader
index 52e861d9..bca7bfda 100644
--- a/test/test_highlight_placement.vader
+++ b/test/test_highlight_placement.vader
@@ -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()