Add inactive statusline for terminal

This commit is contained in:
Christian Brabandt 2018-11-20 16:32:55 +01:00
parent bc63a60b0f
commit c047abfe96
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -18,6 +18,15 @@ function! airline#extensions#term#apply(...)
endif
endfunction
function! airline#extensions#term#inactive_apply(...)
if getbufvar(a:2.bufnr, '&buftype') == 'terminal'
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.'TERMINAL'.spc)
call a:1.add_section('airline_b', spc.'%f')
return 1
endif
endfunction
function! s:termname()
let bufname = bufname('%')
if has('nvim')
@ -30,4 +39,5 @@ endfunction
function! airline#extensions#term#init(ext)
call a:ext.add_statusline_func('airline#extensions#term#apply')
call a:ext.add_inactive_statusline_func('airline#extensions#term#inactive_apply')
endfunction