summaryrefslogtreecommitdiff
path: root/test/test_highlight_placement.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-28 19:36:16 +0100
committerw0rp <devw0rp@gmail.com>2017-10-28 19:36:16 +0100
commit5fc2b98b73b74a0d57037683f0c809eac41368f0 (patch)
treec0f1b45cb936c19130d1a91c283d8f310546bd8a /test/test_highlight_placement.vader
parentea3a8e3c62d3051fee9342ece2e04bcd04b392b6 (diff)
downloadale-5fc2b98b73b74a0d57037683f0c809eac41368f0.zip
#817 Add commands for toggling ALE for only the current buffer
Diffstat (limited to 'test/test_highlight_placement.vader')
-rw-r--r--test/test_highlight_placement.vader28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader
index 2d87b771..6a84e571 100644
--- a/test/test_highlight_placement.vader
+++ b/test/test_highlight_placement.vader
@@ -1,4 +1,6 @@
Before:
+ Save g:ale_enabled
+
function! GenerateResults(buffer, output)
return [
\ {
@@ -43,7 +45,10 @@ Before:
highlight link SomeOtherGroup SpellBad
After:
+ Restore
+
unlet! g:items
+ unlet! b:ale_enabled
delfunction GenerateResults
call ale#linter#Reset()
@@ -206,7 +211,7 @@ Execute(Highlighting should support errors spanning many lines):
\ },
\ ],
\ GetMatchesWithoutIDs()
- \
+
Execute(Highlights should always be cleared when the buffer highlight list is empty):
" Add our highlights and something else.
call matchaddpos('ALEError', [[1, 1, 1]])
@@ -232,3 +237,24 @@ Execute(Highlights should always be cleared when the buffer highlight list is em
\ {'group': 'SomeOtherGroup', 'priority': 10, 'pos1': [1, 1, 1]},
\ ],
\ GetMatchesWithoutIDs()
+
+Execute(Highlights should be cleared when ALE is disabled):
+ let g:ale_enabled = 1
+ call ale#highlight#SetHighlights(bufnr(''), [
+ \ {'bufnr': bufnr(''), 'type': 'E', 'lnum': 1, 'col': 1, 'end_lnum': 10, 'end_col': 3},
+ \])
+
+ let g:ale_enabled = 0
+ call ale#highlight#UpdateHighlights()
+
+ AssertEqual [], GetMatchesWithoutIDs()
+
+ let g:ale_enabled = 1
+ call ale#highlight#SetHighlights(bufnr(''), [
+ \ {'bufnr': bufnr(''), 'type': 'E', 'lnum': 1, 'col': 1, 'end_lnum': 10, 'end_col': 3},
+ \])
+
+ let b:ale_enabled = 0
+ call ale#highlight#UpdateHighlights()
+
+ AssertEqual [], GetMatchesWithoutIDs()