theme: only define g:autoload_theme if loading was successfully
fixes the test
This commit is contained in:
parent
5b1c92979c
commit
7f6dfbefd1
@ -19,7 +19,7 @@ endfunction
|
|||||||
|
|
||||||
function! airline#add_statusline_funcref(function)
|
function! airline#add_statusline_funcref(function)
|
||||||
if index(g:airline_statusline_funcrefs, a:function) >= 0
|
if index(g:airline_statusline_funcrefs, a:function) >= 0
|
||||||
call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function)))
|
call airline#util#warning('The airline statusline funcref %s has already been added.', string(a:function))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call add(g:airline_statusline_funcrefs, a:function)
|
call add(g:airline_statusline_funcrefs, a:function)
|
||||||
@ -67,8 +67,8 @@ function! airline#switch_theme(name)
|
|||||||
let err = 1
|
let err = 1
|
||||||
else
|
else
|
||||||
exe "ru autoload/airline/themes/". a:name. ".vim"
|
exe "ru autoload/airline/themes/". a:name. ".vim"
|
||||||
|
let g:airline_theme = a:name
|
||||||
endif
|
endif
|
||||||
let g:airline_theme = a:name
|
|
||||||
catch
|
catch
|
||||||
call airline#util#warning(printf('There is an error in theme "%s".', a:name))
|
call airline#util#warning(printf('There is an error in theme "%s".', a:name))
|
||||||
if &vbs
|
if &vbs
|
||||||
@ -98,7 +98,7 @@ endfunction
|
|||||||
function! airline#switch_matching_theme()
|
function! airline#switch_matching_theme()
|
||||||
if exists('g:colors_name')
|
if exists('g:colors_name')
|
||||||
let existing = g:airline_theme
|
let existing = g:airline_theme
|
||||||
let theme = tr(tolower(g:colors_name), '-', '_')
|
let theme = substitute(tolower(g:colors_name), '-', '_', 'g')
|
||||||
try
|
try
|
||||||
call airline#switch_theme(theme)
|
call airline#switch_theme(theme)
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user