mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-09 21:46:39 +08:00
If window is too small, shorten branch name
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user