commit
ae85179c3a
|
@ -77,7 +77,7 @@ function! s:should_change_group(group1, group2)
|
|||
endif
|
||||
let color1 = airline#highlighter#get_highlight(a:group1)
|
||||
let color2 = airline#highlighter#get_highlight(a:group2)
|
||||
if has('gui_running') || has('nvim') || (has("termtruecolor") && &guicolors == 1)
|
||||
if g:airline_gui_mode ==# 'gui'
|
||||
return color1[1] != color2[1] || color1[0] != color2[0]
|
||||
else
|
||||
return color1[3] != color2[3] || color1[2] != color2[2]
|
||||
|
|
|
@ -12,7 +12,7 @@ endif
|
|||
|
||||
|
||||
function! airline#extensions#tabline#init(ext)
|
||||
if has('nvim') || has('gui_running')
|
||||
if has('gui_running')
|
||||
set guioptions-=e
|
||||
endif
|
||||
|
||||
|
|
|
@ -17,14 +17,15 @@ function! s:gui2cui(rgb, fallback)
|
|||
endfunction
|
||||
|
||||
function! s:get_syn(group, what)
|
||||
" need to pass in mode, known to break on 7.3.547
|
||||
let mode = has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm'
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
|
||||
if !exists("g:airline_gui_mode")
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
endif
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
|
||||
if empty(color) || color == -1
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
if g:airline_gui_mode ==# 'gui'
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
|
@ -36,7 +37,7 @@ endfunction
|
|||
function! s:get_array(fg, bg, opts)
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
return g:airline_gui_mode ==# 'gui'
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
endfunction
|
||||
|
@ -44,7 +45,7 @@ endfunction
|
|||
function! airline#highlighter#get_highlight(group, ...)
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
let reverse = has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
let reverse = g:airline_gui_mode ==# 'gui'
|
||||
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
|
||||
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
|
||||
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
|
||||
|
|
|
@ -27,6 +27,7 @@ function! airline#init#bootstrap()
|
|||
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
|
||||
call s:check_defined('g:airline_exclude_filetypes', [])
|
||||
call s:check_defined('g:airline_exclude_preview', 0)
|
||||
call s:check_defined('g:airline_gui_mode', airline#init#gui_mode())
|
||||
|
||||
call s:check_defined('g:airline_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
|
@ -92,6 +93,12 @@ function! airline#init#bootstrap()
|
|||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#gui_mode()
|
||||
return ((has('nvim') && exists('$NVIM_TUI_ENABLE_TRUE_COLOR'))
|
||||
\ || has('gui_running') || (has("termtruecolor") && &guicolors == 1)) ?
|
||||
\ 'gui' : 'cterm'
|
||||
endfunction
|
||||
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
|
|
|
@ -43,6 +43,7 @@ endfunction
|
|||
|
||||
function! s:on_colorscheme_changed()
|
||||
call s:init()
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
if !s:theme_in_vimrc
|
||||
call airline#switch_matching_theme()
|
||||
endif
|
||||
|
@ -77,7 +78,7 @@ function! s:airline_toggle()
|
|||
\ | call <sid>on_window_changed()
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd GUIEnter,ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
\ call <sid>on_window_changed()
|
||||
|
||||
|
|
Loading…
Reference in New Issue