xtabline: use airline#util#warning instead of echo conistently

This commit is contained in:
Christian Brabandt 2018-11-13 21:25:54 +01:00
parent c850f485ad
commit 2eaf57ece8
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -116,14 +116,14 @@ endfunction
function! airline#extensions#tabline#xtabline#toggle_tabs() function! airline#extensions#tabline#xtabline#toggle_tabs()
"""Toggle between tabs/buffers tabline.""" """Toggle between tabs/buffers tabline."""
if tabpagenr("$") == 1 | echo "There is only one tab." | return | endif if tabpagenr("$") == 1 | call airline#util#warning("There is only one tab.") | return | endif
if g:airline#extensions#tabline#show_tabs if g:airline#extensions#tabline#show_tabs
let g:airline#extensions#tabline#show_tabs = 0 let g:airline#extensions#tabline#show_tabs = 0
echo "Showing buffers" call airline#util#warning("Showing buffers")
else else
let g:airline#extensions#tabline#show_tabs = 1 let g:airline#extensions#tabline#show_tabs = 1
echo "Showing tabs" call airline#util#warning("Showing tabs")
endif endif
doautocmd BufAdd doautocmd BufAdd
@ -137,12 +137,12 @@ function! airline#extensions#tabline#xtabline#toggle_buffers()
if s:xtabline_filtering if s:xtabline_filtering
let s:xtabline_filtering = 0 let s:xtabline_filtering = 0
let g:airline#extensions#tabline#exclude_buffers = [] let g:airline#extensions#tabline#exclude_buffers = []
echo "Buffer filtering turned off" call airline#util#warning("Buffer filtering turned off")
doautocmd BufAdd doautocmd BufAdd
else else
let s:xtabline_filtering = 1 let s:xtabline_filtering = 1
call airline#extensions#tabline#xtabline#filter_buffers() call airline#extensions#tabline#xtabline#filter_buffers()
echo "Buffer filtering turned on" call airline#util#warning("Buffer filtering turned on")
doautocmd BufAdd doautocmd BufAdd
endif endif
endfunction endfunction
@ -153,7 +153,9 @@ function! airline#extensions#tabline#xtabline#reopen_last_tab()
"""Reopen the last closed tab.""" """Reopen the last closed tab."""
if !exists('s:most_recently_closed_tab') if !exists('s:most_recently_closed_tab')
echo "No recent tabs." | return | endif call airline#util#warning("No recent tabs.")
return
endif
let tab = s:most_recently_closed_tab let tab = s:most_recently_closed_tab
tabnew tabnew
@ -298,9 +300,9 @@ function! s:NotEnoughBuffers()
if index(t:xtl_accepted, bufnr("%")) == -1 if index(t:xtl_accepted, bufnr("%")) == -1
return return
elseif !len(t:xtl_accepted) elseif !len(t:xtl_accepted)
echo "No available buffers for this tab." call airline#util#warning("No available buffers for this tab.")
else else
echo "No other available buffers for this tab." call airline#util#warning("No other available buffers for this tab.")
endif endif
return 1 return 1
endif endif