Fix messing up folding when Vim is in diff mode
This commit is contained in:
parent
2185815b00
commit
5605f285c1
@ -157,23 +157,25 @@ 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()
|
||||||
let foldmethod = vimwiki#vars#get_global('folding')
|
if !&diff " if Vim is currently in diff mode, don't interfere with its folding
|
||||||
if foldmethod =~? '^expr.*'
|
let foldmethod = vimwiki#vars#get_global('folding')
|
||||||
setlocal foldmethod=expr
|
if foldmethod =~? '^expr.*'
|
||||||
setlocal foldexpr=VimwikiFoldLevel(v:lnum)
|
setlocal foldmethod=expr
|
||||||
setlocal foldtext=VimwikiFoldText()
|
setlocal foldexpr=VimwikiFoldLevel(v:lnum)
|
||||||
elseif foldmethod =~? '^list.*' || foldmethod =~? '^lists.*'
|
setlocal foldtext=VimwikiFoldText()
|
||||||
setlocal foldmethod=expr
|
elseif foldmethod =~? '^list.*' || foldmethod =~? '^lists.*'
|
||||||
setlocal foldexpr=VimwikiFoldListLevel(v:lnum)
|
setlocal foldmethod=expr
|
||||||
setlocal foldtext=VimwikiFoldText()
|
setlocal foldexpr=VimwikiFoldListLevel(v:lnum)
|
||||||
elseif foldmethod =~? '^syntax.*'
|
setlocal foldtext=VimwikiFoldText()
|
||||||
setlocal foldmethod=syntax
|
elseif foldmethod =~? '^syntax.*'
|
||||||
setlocal foldtext=VimwikiFoldText()
|
setlocal foldmethod=syntax
|
||||||
elseif foldmethod =~? '^custom.*'
|
setlocal foldtext=VimwikiFoldText()
|
||||||
" do nothing
|
elseif foldmethod =~? '^custom.*'
|
||||||
else
|
" do nothing
|
||||||
setlocal foldmethod=manual
|
else
|
||||||
normal! zE
|
setlocal foldmethod=manual
|
||||||
|
normal! zE
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if vimwiki#vars#get_global('conceallevel') && exists("+conceallevel")
|
if vimwiki#vars#get_global('conceallevel') && exists("+conceallevel")
|
||||||
|
Loading…
Reference in New Issue
Block a user