Honor minwidth for hunks and branch parts

This removes the hardcoded minwidth limits for both the `hunks` and
`branch` parts. It replaces these with safe accesses to the `minwidth`
setting as done by `airline#parts#define_minwidth`.
This commit is contained in:
Max Nordlund gmail
2019-02-20 12:36:40 +01:00
parent 448aa43ec4
commit 45ff435378
3 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -266,8 +266,9 @@ function! airline#extensions#branch#head()
endif
endif
let winwidth = get(airline#parts#get('branch'), 'minwidth', 120)
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth)
let b:airline_head = airline#util#shorten(b:airline_head, winwidth, minwidth)
return b:airline_head
endfunction