Merge pull request #1034 from blueyed/fallback-to-NONE-in-get_syn
airline#highlighter: s:get_syn: fallback to 'NONE'
This commit is contained in:
commit
37231dac3a
@ -25,11 +25,7 @@ function! s:get_syn(group, what)
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if g:airline_gui_mode ==# 'gui'
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
endif
|
||||
let color = 'NONE'
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
|
@ -28,10 +28,10 @@ describe 'themes'
|
||||
|
||||
it 'should pass args through correctly'
|
||||
let hl = airline#themes#get_highlight('Foo', 'bold', 'italic')
|
||||
Expect hl == ['', '', 0, 1, 'bold,italic']
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'bold,italic']
|
||||
|
||||
let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold')
|
||||
Expect hl == ['', '', 1, 0, 'italic,bold']
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'italic,bold']
|
||||
end
|
||||
|
||||
it 'should generate color map with mirroring'
|
||||
|
Loading…
Reference in New Issue
Block a user