Skip to content

Commit

Permalink
Merge pull request #29 from whiteinge/foldmethod-fix
Browse files Browse the repository at this point in the history
Run diffthis before editing files to avoid foldmethod problem
  • Loading branch information
whiteinge authored Jan 30, 2024
2 parents 05e8d2e + 8f21226 commit 4972d14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/diffconflicts.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,22 @@ function! s:diffconfl()
1delete
silent execute "file RCONFL"
silent execute "set filetype=". l:origFt
diffthis " set foldmethod before editing
silent execute "g/^<<<<<<< /,/^=======\\r\\?$/d"
silent execute "g/^>>>>>>> /d"
setlocal nomodifiable readonly buftype=nofile bufhidden=delete nobuflisted
diffthis

" Set up the left-hand side.
wincmd p
diffthis " set foldmethod before editing
if l:conflictStyle ==? "diff3" || l:conflictStyle ==? "zdiff3"
silent execute "g/^||||||| \\?/,/^>>>>>>> /d"
else
silent execute "g/^=======\\r\\?$/,/^>>>>>>> /d"
endif
silent execute "g/^<<<<<<< /d"
diffthis

diffupdate
endfunction

function! s:showHistory()
Expand Down

0 comments on commit 4972d14

Please sign in to comment.