Skip to content

Commit 829ef38

Browse files
toofishesgitster
authored andcommitted
mergetool-lib: add a three-way diff view for vim/gvim
When the base version is available, use a three-way, four panel view by default. This shows the (local, base, remote) revisions up top and the merged result by itself in the lower pane. All revisions will still scroll together by default, and the cursor still defaults to the merged result edit pane. Signed-off-by: Dan McGee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ae69fd0 commit 829ef38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git-mergetool--lib.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,13 @@ run_merge_tool () {
172172
vimdiff|gvimdiff)
173173
if merge_mode; then
174174
touch "$BACKUP"
175-
"$merge_tool_path" -f -d -c "wincmd l" \
176-
"$LOCAL" "$MERGED" "$REMOTE"
175+
if $base_present; then
176+
"$merge_tool_path" -f -d -c "wincmd J" \
177+
"$MERGED" "$LOCAL" "$BASE" "$REMOTE"
178+
else
179+
"$merge_tool_path" -f -d -c "wincmd l" \
180+
"$LOCAL" "$MERGED" "$REMOTE"
181+
fi
177182
check_unchanged
178183
else
179184
"$merge_tool_path" -f -d -c "wincmd l" \

0 commit comments

Comments
 (0)