mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 12:07:55 +08:00
Merge pull request #2457 from ytian81/remove_hunks_dependency_on_branch
Remove gitgutter hunks summary dependency on branch
This commit is contained in:
commit
17f7dff748
|
@ -52,16 +52,9 @@ function! s:get_hunks_coc() abort
|
|||
return result
|
||||
endfunction
|
||||
|
||||
function! s:is_branch_empty() abort
|
||||
return exists('*airline#extensions#branch#head') &&
|
||||
\ empty(get(b:, 'airline_head', ''))
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_gitgutter() abort
|
||||
if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty()
|
||||
return ''
|
||||
endif
|
||||
return GitGutterGetHunkSummary()
|
||||
let hunks = GitGutterGetHunkSummary()
|
||||
return hunks == [0, 0, 0] ? [] : hunks
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_changes() abort
|
||||
|
|
Loading…
Reference in New Issue
Block a user