If window is too small, shorten branch name

This commit is contained in:
Christian Brabandt 2016-07-02 09:40:04 +02:00
parent fadd737a29
commit 5b00d54cd6

View File

@ -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