Fix inline diff expansion when foldmethod is not syntax

Also rearrange, so any other errors here don't break the basics.
This commit is contained in:
Tim Pope
2021-03-16 20:07:51 -04:00
parent caf2907fd8
commit d73fe3c192

View File

@@ -3490,11 +3490,11 @@ function! s:StageInline(mode, ...) abort
if len(diff)
setlocal modifiable noreadonly
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)]
setlocal nomodifiable readonly nomodified
if foldclosed(lnum+1) > 0
silent exe (lnum+1) . ',' . (lnum+len(diff)) . 'foldopen!'
endif
endif
endwhile
return lnum