Collapse all status buffer diffs on :edit!

References: https://github.com/tpope/vim-fugitive/issues/1563
This commit is contained in:
Tim Pope
2021-10-01 14:26:58 -04:00
parent e2883a5426
commit a67854368e

View File

@@ -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': {}}