You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
953 B
Plaintext
34 lines
953 B
Plaintext
7 years ago
|
Before:
|
||
|
function! ParseHighlight(name) abort
|
||
|
redir => l:output
|
||
|
silent execute 'highlight ' . a:name
|
||
|
redir end
|
||
|
|
||
|
return join(split(l:output)[2:])
|
||
|
endfunction
|
||
|
|
||
|
function! SetHighlight(name, syntax) abort
|
||
|
let l:match = matchlist(a:syntax, '\vlinks to (.+)$')
|
||
|
|
||
|
if !empty(l:match)
|
||
|
execute 'highlight link ' . a:name . ' ' . l:match[1]
|
||
|
else
|
||
|
execute 'highlight ' . a:name . ' ' a:syntax
|
||
|
endif
|
||
|
endfunction
|
||
|
|
||
|
let g:sign_highlight = ParseHighlight('SignColumn')
|
||
|
|
||
|
After:
|
||
|
delfunction ParseHighlight
|
||
|
call SetHighlight('SignColumn', g:sign_highlight)
|
||
|
delfunction SetHighlight
|
||
|
unlet! g:sign_highlight
|
||
|
|
||
|
Execute(The SignColumn highlight should be set and reset):
|
||
|
call ale#sign#SetSignColumnHighlight(1)
|
||
|
AssertEqual 'links to ALESignColumnWithErrors', ParseHighlight('SignColumn')
|
||
|
|
||
|
call ale#sign#SetSignColumnHighlight(0)
|
||
|
AssertEqual 'links to ALESignColumnWithoutErrors', ParseHighlight('SignColumn')
|