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:
Christian Brabandt
2020-10-26 21:16:31 +01:00
parent 38c9f9ca3d
commit c8c0e7d9ff
6 changed files with 73 additions and 63 deletions

View File

@@ -31,7 +31,6 @@ 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, {
@@ -185,10 +184,6 @@ function! airline#init#bootstrap()
unlet g:airline#init#bootstrapping
endfunction
function! airline#init#gui_mode()
return has('gui_running') || (has("termguicolors") && &termguicolors == 1) ? 'gui' : 'cterm'
endfunction
function! airline#init#sections()
let spc = g:airline_symbols.space
if !exists('g:airline_section_a')