From 53dcd8a49ccdb80dfcd6e647dbf57b063d02d316 Mon Sep 17 00:00:00 2001 From: Julien Pivard Date: Sun, 24 Jul 2016 21:15:10 +0200 Subject: [PATCH] Hunks won't appear if g:airline_skip_empty_sections = 1 --- autoload/airline/extensions/hunks.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions/hunks.vim b/autoload/airline/extensions/hunks.vim index 3044ec1..6be8368 100644 --- a/autoload/airline/extensions/hunks.vim +++ b/autoload/airline/extensions/hunks.vim @@ -45,7 +45,7 @@ function! s:get_hunks_empty() endfunction function! s:get_hunks() - if !exists('b:source_func') + if !exists('b:source_func') || get(b:, 'source_func', '') is# 's:get_hunks_empty' if get(g:, 'loaded_signify') && sy#buffer_is_active() let b:source_func = 's:get_hunks_signify' elseif exists('*GitGutterGetHunkSummary') @@ -67,8 +67,10 @@ function! airline#extensions#hunks#get_hunks() endif " Cache vavlues, so that it isn't called too often if exists("b:airline_hunks") && - \ get(b:, 'airline_changenr', 0) == changenr() && - \ winwidth(0) == get(s:, 'airline_winwidth', 0) + \ get(b:, 'airline_changenr', 0) == changenr() && + \ winwidth(0) == get(s:, 'airline_winwidth', 0) && + \ get(b:, 'source_func', '') isnot# 's:get_hunks_signify' && + \ get(b:, 'source_func', '') isnot# 's:get_hunks_empty' return b:airline_hunks endif let hunks = s:get_hunks()