mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +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:
@@ -99,7 +99,6 @@ function! s:on_colorscheme_changed()
|
||||
call s:init()
|
||||
unlet! g:airline#highlighter#normal_fg_hi
|
||||
call airline#highlighter#reset_hlcache()
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
if !s:theme_in_vimrc
|
||||
call airline#switch_matching_theme()
|
||||
endif
|
||||
@@ -139,11 +138,7 @@ function! s:airline_toggle()
|
||||
\ | call <sid>on_window_changed('CmdwinEnter')
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd GUIEnter,ColorScheme * call <sid>on_colorscheme_changed()
|
||||
if exists("##OptionSet")
|
||||
" Make sure that g_airline_gui_mode is refreshed
|
||||
autocmd OptionSet termguicolors call <sid>on_colorscheme_changed()
|
||||
endif
|
||||
autocmd ColorScheme * call <sid>on_colorscheme_changed()
|
||||
" Set all statuslines to inactive
|
||||
autocmd FocusLost * call airline#update_statusline_focuslost()
|
||||
" Refresh airline for :syntax off
|
||||
|
||||
Reference in New Issue
Block a user