Skip to content

Commit 5e23411

Browse files
committed
Support diff3 conflictStyle
This adds support for Git's diff3 style conflict markers by simply ignoring the section that refers to the base version. Diff3 is already supported through the :DiffConflictsShowHistory command.
1 parent 400c8bd commit 5e23411

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugin/diffconflicts.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ endfunction
2222
function! s:diffconfl()
2323
let l:origBuf = bufnr("%")
2424
let l:origFt = &filetype
25+
let l:conflictStyle = trim(system("git config --get merge.conflictStyle"))
2526

2627
" Set up the right-hand side.
2728
rightb vsplit
@@ -37,7 +38,11 @@ function! s:diffconfl()
3738

3839
" Set up the left-hand side.
3940
wincmd p
40-
silent execute "g/^=======\\r\\?$/,/^>>>>>>> /d"
41+
if l:conflictStyle == "diff3"
42+
silent execute "g/^||||||| \\?/,/^>>>>>>> /d"
43+
else
44+
silent execute "g/^=======\\r\\?$/,/^>>>>>>> /d"
45+
endif
4146
silent execute "g/^<<<<<<< /d"
4247
diffthis
4348
endfunction

0 commit comments

Comments
 (0)