hunks: do not add trailing whitespace when branch extension is disabled

fixes #2177
This commit is contained in:
Christian Brabandt 2020-07-14 14:01:04 +02:00
parent 767107070e
commit f655add4e9
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,11 @@ function! airline#extensions#hunks#get_hunks() abort
endif
endfor
endif
if index(airline#extensions#get_loaded_extensions(), 'branch') == -1 && string[-1:] == ' '
" branch extension not loaded, skip trailing whitespace
let string = string[0:-2]
endif
let b:airline_hunks = string
let b:airline_changenr = b:changedtick
let s:airline_winwidth = airline#util#winwidth()