Fix messing up folding when Vim is in diff mode

This commit is contained in:
EinfachToll 2018-08-07 21:39:54 +02:00
parent 2185815b00
commit 5605f285c1

View File

@ -157,6 +157,7 @@ endfunction
" Vim defaults. So we enforce our settings here when the cursor enters a " Vim defaults. So we enforce our settings here when the cursor enters a
" Vimwiki buffer. " Vimwiki buffer.
function! s:set_windowlocal_options() function! s:set_windowlocal_options()
if !&diff " if Vim is currently in diff mode, don't interfere with its folding
let foldmethod = vimwiki#vars#get_global('folding') let foldmethod = vimwiki#vars#get_global('folding')
if foldmethod =~? '^expr.*' if foldmethod =~? '^expr.*'
setlocal foldmethod=expr setlocal foldmethod=expr
@ -175,6 +176,7 @@ function! s:set_windowlocal_options()
setlocal foldmethod=manual setlocal foldmethod=manual
normal! zE normal! zE
endif endif
endif
if vimwiki#vars#get_global('conceallevel') && exists("+conceallevel") if vimwiki#vars#get_global('conceallevel') && exists("+conceallevel")
let &conceallevel = vimwiki#vars#get_global('conceallevel') let &conceallevel = vimwiki#vars#get_global('conceallevel')