mirror of
https://github.com/vim-airline/vim-airline
synced 2025-02-20 12:36:58 +00:00
terminal: correctly shorten terminal tabline
If there is a single terminal window in the current tabpage, the whole long command will be displayed in the tabline, even when it should be shortened by default. By default the title will not be shown if there are several windows in the current tabpage, but if there is only one single terminal window, it will still be shown (and might be a bit long). But I guess, it is better to just show a possible too long terminal window name, than not show anything). fixes #2126
This commit is contained in:
parent
5ce3e63658
commit
bc8fdfe946
@ -190,9 +190,11 @@ function! airline#extensions#tabline#title(n)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
let all_buffers = airline#extensions#tabline#buflist#list()
|
||||
return airline#extensions#tabline#get_buffer_name(
|
||||
\ buflist[winnr - 1],
|
||||
\ filter(buflist, 'index(all_buffers, v:val) != -1'))
|
||||
let curbuf = filter(buflist, 'index(all_buffers, v:val) != -1')
|
||||
if len(curbuf) == 0
|
||||
call add(curbuf, tabpagebuflist()[0])
|
||||
endif
|
||||
return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf)
|
||||
endif
|
||||
|
||||
return title
|
||||
|
Loading…
Reference in New Issue
Block a user