mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-08 13:04:44 +08:00
echo warning message if duplicate statusline func gets added.
This commit is contained in:
@@ -11,6 +11,12 @@ function! airline#add_statusline_func(name)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#add_statusline_funcref(function)
|
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)
|
call add(g:airline_statusline_funcrefs, a:function)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user