From 0aed51565eae5f03dc400409ef73697333bb4f16 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 3 May 2017 23:27:42 +0100 Subject: Fix #528 remove and restore highlights when buffers are hidden and shown --- test/test_highlight_placement.vader | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/test_highlight_placement.vader') diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader index bca7bfda..14c16328 100644 --- a/test/test_highlight_placement.vader +++ b/test/test_highlight_placement.vader @@ -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!' -- cgit v1.2.3