echo warning message if duplicate statusline func gets added.

This commit is contained in:
Bailey Ling 2013-10-04 10:27:49 -04:00
parent 008eb8cd3b
commit f26c7d4143

View File

@ -11,6 +11,12 @@ function! airline#add_statusline_func(name)
endfunction
function! airline#add_statusline_funcref(function)
if index(g:airline_statusline_funcrefs, a:function) >= 0
echohl WarningMsg
echo 'The airline statusline funcref '.string(a:function).' has already been added.'
echohl NONE
return
endif
call add(g:airline_statusline_funcrefs, a:function)
endfunction