From d73fe3c1920576c10e18d8245b860e29e55a6813 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 16 Mar 2021 20:07:51 -0400 Subject: [PATCH] Fix inline diff expansion when foldmethod is not syntax Also rearrange, so any other errors here don't break the basics. --- autoload/fugitive.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 381fca5..6b686df 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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