reload colors when tomorrow theme changes

This commit is contained in:
Bailey Ling 2013-08-06 08:31:45 -04:00
parent 729f9e8354
commit 835f718cb6
3 changed files with 7 additions and 2 deletions

View File

@ -29,6 +29,11 @@ function! airline#exec_highlight(group, colors)
\ colors[4] != '' ? 'term='.colors[4] : '') \ colors[4] != '' ? 'term='.colors[4] : '')
endfunction endfunction
function! airline#reload_highlight()
call airline#highlight(['inactive'])
call airline#highlight(['normal'])
endfunction
function! airline#load_theme(name) function! airline#load_theme(name)
let g:airline_theme = a:name let g:airline_theme = a:name
let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme

View File

@ -36,5 +36,5 @@ endfunction
call s:generate() call s:generate()
augroup airline_tomorrow augroup airline_tomorrow
autocmd! autocmd!
autocmd ColorScheme * call <sid>generate() autocmd ColorScheme * call <sid>generate() | call airline#reload_highlight()
augroup END augroup END

View File

@ -93,7 +93,7 @@ command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call
augroup airline augroup airline
autocmd! autocmd!
autocmd ColorScheme * call airline#highlight(['normal']) autocmd ColorScheme * call airline#reload_highlight()
autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost * autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost *
\ call <sid>on_window_changed() \ call <sid>on_window_changed()
autocmd CursorMoved * call <sid>sync_active_winnr() autocmd CursorMoved * call <sid>sync_active_winnr()