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 <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dan McGee committed
Sep 14, 2010 at 21:21 UTC
829ef383a2b03a614d7d23e575270f2b10a805c1
1 file changed
+7
-2
git-mergetool--lib.sh
+7
-2
@@ -172,8 +172,13 @@ run_merge_tool () {
172
vimdiff|gvimdiff)
173
if merge_mode; then
174
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
182
check_unchanged
183
else
184
"$merge_tool_path" -f -d -c "wincmd l" \