Skip to content

Commit 4972d14

Browse files
authored
Merge pull request #29 from whiteinge/foldmethod-fix
Run diffthis before editing files to avoid foldmethod problem
2 parents 05e8d2e + 8f21226 commit 4972d14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/diffconflicts.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,22 @@ function! s:diffconfl()
4545
1delete
4646
silent execute "file RCONFL"
4747
silent execute "set filetype=". l:origFt
48+
diffthis " set foldmethod before editing
4849
silent execute "g/^<<<<<<< /,/^=======\\r\\?$/d"
4950
silent execute "g/^>>>>>>> /d"
5051
setlocal nomodifiable readonly buftype=nofile bufhidden=delete nobuflisted
51-
diffthis
5252

5353
" Set up the left-hand side.
5454
wincmd p
55+
diffthis " set foldmethod before editing
5556
if l:conflictStyle ==? "diff3" || l:conflictStyle ==? "zdiff3"
5657
silent execute "g/^||||||| \\?/,/^>>>>>>> /d"
5758
else
5859
silent execute "g/^=======\\r\\?$/,/^>>>>>>> /d"
5960
endif
6061
silent execute "g/^<<<<<<< /d"
61-
diffthis
62+
63+
diffupdate
6264
endfunction
6365

6466
function! s:showHistory()

0 commit comments

Comments
 (0)