mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-01-30 14:45:21 +08:00
Get rid of g:airline_gui_mode
This is needed for Neovim, because an external UI could be attached to the same neovim server, so it does not make sense to define highlighting groups with either only the cterm or the guifg attribute set. So refactor the code slightly got get rid of this variable (and since this variable is not needed anymore, we can also get rid of the guienter and OptionSet autocommand). fixes: #2261
This commit is contained in:
25
t/themes.vim
25
t/themes.vim
@@ -8,23 +8,42 @@ describe 'themes'
|
||||
call airline#highlighter#reset_hlcache()
|
||||
highlight Foo ctermfg=1 ctermbg=2
|
||||
let colors = airline#themes#get_highlight('Foo')
|
||||
Expect colors[0] == 'NONE'
|
||||
Expect colors[1] == 'NONE'
|
||||
Expect colors[2] == '1'
|
||||
Expect colors[3] == '2'
|
||||
end
|
||||
|
||||
if exists("+termguicolors")
|
||||
it 'should extract correct colors with termguicolors'
|
||||
call airline#highlighter#reset_hlcache()
|
||||
set termguicolors
|
||||
highlight Foo guifg=#cd0000 guibg=#00cd00 ctermfg=1 ctermbg=2
|
||||
let colors = airline#themes#get_highlight('Foo')
|
||||
Expect colors[0] == '#cd0000'
|
||||
Expect colors[1] == '#00cd00'
|
||||
Expect colors[2] == '1'
|
||||
Expect colors[3] == '2'
|
||||
end
|
||||
endif
|
||||
|
||||
it 'should extract from normal if colors unavailable'
|
||||
call airline#highlighter#reset_hlcache()
|
||||
highlight Normal ctermfg=100 ctermbg=200
|
||||
highlight Foo ctermbg=2
|
||||
let colors = airline#themes#get_highlight('Foo')
|
||||
Expect colors[0] == 'NONE'
|
||||
Expect colors[1] == 'NONE'
|
||||
Expect colors[2] == '100'
|
||||
Expect colors[3] == '2'
|
||||
end
|
||||
|
||||
it 'should flip target group if it is reversed'
|
||||
call airline#highlighter#reset_hlcache()
|
||||
highlight Foo ctermbg=222 ctermfg=103 term=reverse
|
||||
highlight Foo ctermbg=222 ctermfg=103 cterm=reverse
|
||||
let colors = airline#themes#get_highlight('Foo')
|
||||
Expect colors[0] == 'NONE'
|
||||
Expect colors[1] == 'NONE'
|
||||
Expect colors[2] == '222'
|
||||
Expect colors[3] == '103'
|
||||
end
|
||||
@@ -33,10 +52,10 @@ describe 'themes'
|
||||
call airline#highlighter#reset_hlcache()
|
||||
hi clear Normal
|
||||
let hl = airline#themes#get_highlight('Foo', 'bold', 'italic')
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'bold,italic']
|
||||
Expect hl == ['NONE', 'NONE', 'NONE', 'NONE', 'bold,italic']
|
||||
|
||||
let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold')
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'italic,bold']
|
||||
Expect hl == ['NONE', 'NONE', 'NONE', 'NONE', 'italic,bold']
|
||||
end
|
||||
|
||||
it 'should generate color map with mirroring'
|
||||
|
||||
Reference in New Issue
Block a user