From 9ad59f838836b861d9b38ab152bfa32a6b916290 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 5 Nov 2017 00:31:57 -0400 Subject: fix folds when entering and leaving the diff mode --- vim/plugin/diff.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vim') diff --git a/vim/plugin/diff.vim b/vim/plugin/diff.vim index 8c4f44a..7e72569 100644 --- a/vim/plugin/diff.vim +++ b/vim/plugin/diff.vim @@ -25,8 +25,6 @@ function! s:diffstart(read_cmd) diffthis wincmd p diffthis - " why does this not happen automatically? - normal! zM endfunction function! s:diffstop() @@ -39,7 +37,11 @@ function! s:diffstop() let &foldmethod = s:foldmethod let &foldenable = s:foldenable if &foldenable - normal! zv + if &foldmethod == 'marker' + normal! zv + else + normal! zE + end endif let s:diffwindow = 0 endfunction -- cgit v1.2.3-54-g00ecf