mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-23 22:15:28 +02:00
If window is too small, shorten branch name
This commit is contained in:
parent
fadd737a29
commit
5b00d54cd6
@ -162,6 +162,9 @@ function! airline#extensions#branch#head()
|
|||||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||||
let b:airline_head = ''
|
let b:airline_head = ''
|
||||||
endif
|
endif
|
||||||
|
if winwidth(0) < 120 && len(split(b:airline_head, '\zs')) > 9
|
||||||
|
let b:airline_head = matchstr(b:airline_head, '^.\{9\}').'…'
|
||||||
|
endif
|
||||||
return b:airline_head
|
return b:airline_head
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user