themes: Do not try to load the palette twice

This will be done explicitly by the switch_theme() function
This commit is contained in:
Christian Brabandt 2018-11-13 21:17:48 +01:00
parent d441b3f7b6
commit 464633baad
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -86,14 +86,12 @@ function! airline#switch_matching_theme()
let existing = g:airline_theme let existing = g:airline_theme
let theme = substitute(tolower(g:colors_name), '-', '_', 'g') let theme = substitute(tolower(g:colors_name), '-', '_', 'g')
try try
let palette = g:airline#themes#{theme}#palette
call airline#switch_theme(theme) 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)
if match(g:colors_name, map[0]) > -1 if match(g:colors_name, map[0]) > -1
try try
let palette = g:airline#themes#{map[1]}#palette
call airline#switch_theme(map[1]) call airline#switch_theme(map[1])
catch catch
call airline#switch_theme(existing) call airline#switch_theme(existing)