threads / patch / 17247

patch, 2 partsdifftool: put the cursor on the editable file for Vim

Subject: [PATCH (resend) 2/2] difftool: put the cursor on the editable file for Vim

## tl;dr

2 messages between Jan 19, 2009 and Jan 19, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

David Aguilar· Jan 19, 2009, 05:34 UTC · lore

You only need to edit worktree files when comparing against the worktree. Put the cursor automatically into its window for vimdiff and gvimdiff to avoid doing <C-w>l every time.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/difftool/git-difftool-helper |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Show changes to contrib/difftool/git-difftool-helper +6 −2
diff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper
index 0b266e3..a6f862f 100755
--- a/contrib/difftool/git-difftool-helper
+++ b/contrib/difftool/git-difftool-helper
@@ -78,12 +78,16 @@ launch_merge_tool () {
 		"$merge_tool_path" -o "$MERGED" "$LOCAL" "$REMOTE"
 		;;
 
-	meld|vimdiff)
+	meld)
 		"$merge_tool_path" "$LOCAL" "$REMOTE"
 		;;
 
+	vimdiff)
+		"$merge_tool_path" -c "wincmd l" "$LOCAL" "$REMOTE"
+		;;
+
 	gvimdiff)
-		"$merge_tool_path" -f "$LOCAL" "$REMOTE"
+		"$merge_tool_path" -c "wincmd l" -f "$LOCAL" "$REMOTE"
 		;;
 
 	xxdiff)
-- 
1.6.1.149.g7bbd8
Junio C Hamano· Jan 19, 2009, 06:43 UTC · re: David Aguilar · lore

Re: [PATCH (resend) 2/2] difftool: put the cursor on the editable file for Vim

Ok, I see you updated from r to l.

Please do not mark such "an earlier one had a thinko, and here is a corrected patch" as "resend". It is confusing, because "resend" usually means "I sent this earlier but somehow it did not reach the list, so here is another copy verbatim."

Instead, please add a sentence or two after "---" lines to explain the situation, like...

    You only need to edit worktree files when comparing against
    the worktree.  Put the cursor automatically into its window for
    vimdiff and gvimdiff to avoid doing <C-w>r every time.
    Signed-off-by: David Aguilar <davvid@gmail.com>
    ---
    Markus pointed out that 'l' is not left (it is right as in vi key
    bindings).
     contrib/difftool/git-difftool-helper |    8 ++++++--
     1 files changed, 6 insertions(+), 2 deletions(-)

and say "[PATCH 2/2 (corrected)]" so that I can easily tell which one was a dud and which one I should take.

This time it wasn't confusing because the exchange between Markus and you were the only unread messages before your three patches in my mailbox, but you are not always that lucky.

Will take your original 1/2 and this one.
Thanks.

← back to recent threads