Ensure open folds after expanding inline diff

This commit is contained in:
Tim Pope
2021-03-13 20:06:18 -05:00
parent e3b7cce2e6
commit 776ce315c4

View File

@@ -3485,6 +3485,9 @@ function! s:StageInline(mode, ...) abort
if len(diff) if len(diff)
setlocal modifiable noreadonly setlocal modifiable noreadonly
silent call append(lnum, diff) silent call append(lnum, diff)
if foldclosed(lnum+1)
silent exe (lnum+1) . ',' . (lnum+len(diff)) . 'foldopen!'
endif
let b:fugitive_expanded[info.section][info.filename] = [start, len(diff)] let b:fugitive_expanded[info.section][info.filename] = [start, len(diff)]
setlocal nomodifiable readonly nomodified setlocal nomodifiable readonly nomodified
endif endif