mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-16 00:37:08 +08:00
Cache hunk values, shorten for small windows
Cache the hunk values. In case of short windows, shorten the hunk string a little bit and make the branch extension take the hunk value into account when deciding how much to shorten it.
This commit is contained in:
@@ -166,7 +166,8 @@ function! airline#extensions#branch#head()
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
let b:airline_head = airline#util#shorten(b:airline_head, 120, 9)
|
||||
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7
|
||||
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth)
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user