From 4b33adee4282e4639de8761eeeaee5bdf48fac3d Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 1 Sep 2013 22:25:43 +0000 Subject: [PATCH] possible fix for exit code (#79). --- autoload/airline.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index 1f063a26..202920ad 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -48,19 +48,18 @@ endfunction function! airline#switch_matching_theme() if exists('g:colors_name') - let v:errmsg = '' - silent! let palette = g:airline#themes#{g:colors_name}#palette - if empty(v:errmsg) + try + let palette = g:airline#themes#{g:colors_name}#palette call airline#switch_theme(g:colors_name) return 1 - else + catch for map in items(g:airline_theme_map) if match(g:colors_name, map[0]) > -1 call airline#switch_theme(map[1]) return 1 endif endfor - endif + endtry endif return 0 endfunction