mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-23 20:31:27 +08:00
fix load regression errors with recent theme changes
This commit is contained in:
@@ -71,14 +71,20 @@ endfunction
|
||||
|
||||
function! airline#switch_matching_theme()
|
||||
if exists('g:colors_name')
|
||||
let existing = g:airline_theme
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
silent call airline#switch_theme(g:colors_name)
|
||||
call airline#switch_theme(g:colors_name)
|
||||
return 1
|
||||
catch
|
||||
for map in items(g:airline_theme_map)
|
||||
if match(g:colors_name, map[0]) > -1
|
||||
silent call airline#switch_theme(map[1])
|
||||
try
|
||||
let palette = g:airline#themes#{map[1]}#palette
|
||||
call airline#switch_theme(map[1])
|
||||
catch
|
||||
call airline#switch_theme(existing)
|
||||
endtry
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
Reference in New Issue
Block a user