Fix matching of themes to color names

theme usually use '_' instead of '-', so replace that first before
trying to match.

Second, make the patterns easier to match.

Third, make sure, match for Tomorrow happens with matching case

fixes #1056
This commit is contained in:
Christian Brabandt
2016-02-25 08:07:51 +01:00
parent 5ab8b754d8
commit 78e1a2c8db
2 changed files with 6 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ endfunction
function! airline#switch_matching_theme()
if exists('g:colors_name')
let existing = g:airline_theme
let existing = substitute(g:airline_theme, '-', '_', 'g')
try
let palette = g:airline#themes#{g:colors_name}#palette
call airline#switch_theme(g:colors_name)