From d8dcc56af58d1545cf3a7a9f6160d8ba6ad39923 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 19 Apr 2017 22:55:06 +0100 Subject: Remove error highlights when buffers are cleaned up --- test/test_highlight_placement.vader | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/test_highlight_placement.vader') 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() -- cgit v1.2.3