From 2a0411c10c0c3a55c4442e9d45834f57abb5f077 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Mon, 15 Mar 2021 16:45:26 +0000 Subject: [PATCH] Revert GitGutterGetHunkSummary() to show hunks when inactive In da77e46310e7e88fac8c837b3065341c3c944b87 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 #771. --- plugin/gitgutter.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 8bef52d..5214adf 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -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 " }}}