From a67854368ea9810936d57e3fea00a4c05bf47c26 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 1 Oct 2021 14:26:58 -0400 Subject: [PATCH] Collapse all status buffer diffs on :edit! References: https://github.com/tpope/vim-fugitive/issues/1563 --- autoload/fugitive.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 119cdab..3c106f5 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2752,6 +2752,9 @@ function! fugitive#BufReadStatus() abort \ s:LinesError(['diff', '--color=never', '--no-ext-diff', '--no-prefix'])[0] endif let b:fugitive_diff = diff + if v:cmdbang + unlet! b:fugitive_expanded + endif let expanded = get(b:, 'fugitive_expanded', {'Staged': {}, 'Unstaged': {}}) let b:fugitive_expanded = {'Staged': {}, 'Unstaged': {}}