Skip to content

Commit

Permalink
Revert GitGutterGetHunkSummary() to show hunks when inactive
Browse files Browse the repository at this point in the history
In da77e46 the function changed to be
consistent with GitGutterGetHunks(), i.e. to show "no data" if called in
a buffer for which gitgutter is inactive.

This function is mostly used in status lines.  GitGutter is inactive
when a popup window is open.  The commit mentioned above meant that when
a completion window was open, the hunk summary in the status line
changed to show no data.  It changed back again once the completion
window was closed, but the overall effect was a little distracting.

This commit reverts the change.

Closes airblade#771.
  • Loading branch information
airblade committed Mar 15, 2021
1 parent 1283ec1 commit 2a0411c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugin/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ endfunction
" window. The format is [ added, modified, removed ], where each value
" represents the number of lines added/modified/removed respectively.
function! GitGutterGetHunkSummary()
let bufnr = bufnr('')
return gitgutter#utility#is_active(bufnr) ? gitgutter#hunk#summary(bufnr) : [0,0,0]
return gitgutter#hunk#summary(winbufnr(0))
endfunction

" }}}
Expand Down

0 comments on commit 2a0411c

Please sign in to comment.