diff options
author | w0rp <devw0rp@gmail.com> | 2017-09-12 21:17:54 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-09-12 21:17:54 +0100 |
commit | 91df9ba2c0ccbe53e7838d16642e00c6280eefaa (patch) | |
tree | 3c1e64596c12c2815075b4f9725a5cb71c73492c /test/sign | |
parent | 4e9420d1f581d72bef17554b36073cca584a752f (diff) | |
download | ale-91df9ba2c0ccbe53e7838d16642e00c6280eefaa.zip |
Fix #924 - Make changing the sign column color work again
Diffstat (limited to 'test/sign')
-rw-r--r-- | test/sign/test_sign_column_highlighting.vader | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/test/sign/test_sign_column_highlighting.vader b/test/sign/test_sign_column_highlighting.vader index 882b03de..4457a45c 100644 --- a/test/sign/test_sign_column_highlighting.vader +++ b/test/sign/test_sign_column_highlighting.vader @@ -1,4 +1,6 @@ Before: + Save g:ale_change_sign_column_color + function! ParseHighlight(name) abort redir => l:output silent execute 'highlight ' . a:name @@ -20,14 +22,34 @@ Before: let g:sign_highlight = ParseHighlight('SignColumn') After: + Restore + delfunction ParseHighlight call SetHighlight('SignColumn', g:sign_highlight) delfunction SetHighlight unlet! g:sign_highlight + sign unplace * + +Execute(The SignColumn highlight shouldn't be changed if the option is off): + let g:ale_change_sign_column_color = 0 + let b:sign_highlight = ParseHighlight('SignColumn') + + call ale#sign#SetSigns(bufnr(''), [ + \ {'bufnr': bufnr(''), 'lnum': 1, 'col': 1, 'type': 'W', 'text': 'x'}, + \]) + AssertEqual b:sign_highlight, ParseHighlight('SignColumn') + + call ale#sign#SetSigns(bufnr(''), []) + AssertEqual b:sign_highlight, ParseHighlight('SignColumn') + Execute(The SignColumn highlight should be set and reset): - call ale#sign#SetSignColumnHighlight(1) + let g:ale_change_sign_column_color = 1 + + call ale#sign#SetSigns(bufnr(''), [ + \ {'bufnr': bufnr(''), 'lnum': 1, 'col': 1, 'type': 'W', 'text': 'x'}, + \]) AssertEqual 'links to ALESignColumnWithErrors', ParseHighlight('SignColumn') - call ale#sign#SetSignColumnHighlight(0) + call ale#sign#SetSigns(bufnr(''), []) AssertEqual 'links to ALESignColumnWithoutErrors', ParseHighlight('SignColumn') |