Fix colorscheme to theme matching

Fixes #1067 for real.
This commit is contained in:
Kevin Ballard 2016-02-27 11:22:30 -08:00
parent a7eb735f2e
commit 4540ea428a
1 changed files with 4 additions and 3 deletions

View File

@ -71,10 +71,11 @@ endfunction
function! airline#switch_matching_theme() function! airline#switch_matching_theme()
if exists('g:colors_name') if exists('g:colors_name')
let existing = substitute(g:colors_name, '-', '_', 'g') let existing = g:airline_theme
let theme = substitute(g:colors_name, '-', '_', 'g')
try try
let palette = g:airline#themes#{g:colors_name}#palette let palette = g:airline#themes#{theme}#palette
call airline#switch_theme(g:colors_name) call airline#switch_theme(theme)
return 1 return 1
catch catch
for map in items(g:airline_theme_map) for map in items(g:airline_theme_map)