diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-11-05 00:31:57 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-11-05 00:32:20 -0400 |
commit | 9ad59f838836b861d9b38ab152bfa32a6b916290 (patch) | |
tree | 4e2740cc8c9c708d601ace8643819713694908ff /vim | |
parent | d37623b6e940dda1f9b8ad11a9596bd6d3155780 (diff) | |
download | conf-9ad59f838836b861d9b38ab152bfa32a6b916290.tar.gz conf-9ad59f838836b861d9b38ab152bfa32a6b916290.zip |
fix folds when entering and leaving the diff mode
Diffstat (limited to 'vim')
-rw-r--r-- | vim/plugin/diff.vim | 8 |
1 files changed, 5 insertions, 3 deletions
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 |