mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-02-21 19:48:40 +08: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()
|
||||
let b:airline_head = ''
|
||||
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
|
||||
endfunction
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user