From 835f718cb65986a99c27b3d1833d52d774af28a3 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Tue, 6 Aug 2013 08:31:45 -0400 Subject: [PATCH] reload colors when tomorrow theme changes --- autoload/airline.vim | 5 +++++ autoload/airline/themes/tomorrow.vim | 2 +- plugin/airline.vim | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index 52d2522a..b6f368e5 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -29,6 +29,11 @@ function! airline#exec_highlight(group, colors) \ colors[4] != '' ? 'term='.colors[4] : '') endfunction +function! airline#reload_highlight() + call airline#highlight(['inactive']) + call airline#highlight(['normal']) +endfunction + function! airline#load_theme(name) let g:airline_theme = a:name let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme diff --git a/autoload/airline/themes/tomorrow.vim b/autoload/airline/themes/tomorrow.vim index 193a9c09..b1886817 100644 --- a/autoload/airline/themes/tomorrow.vim +++ b/autoload/airline/themes/tomorrow.vim @@ -36,5 +36,5 @@ endfunction call s:generate() augroup airline_tomorrow autocmd! - autocmd ColorScheme * call generate() + autocmd ColorScheme * call generate() | call airline#reload_highlight() augroup END diff --git a/plugin/airline.vim b/plugin/airline.vim index 7904b744..44631dca 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -93,7 +93,7 @@ command! -nargs=? -complete=customlist,get_airline_themes AirlineTheme call augroup airline autocmd! - autocmd ColorScheme * call airline#highlight(['normal']) + autocmd ColorScheme * call airline#reload_highlight() autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost * \ call on_window_changed() autocmd CursorMoved * call sync_active_winnr()