public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: David Aguilar <davvid@gmail•com>
Cc: git@vger•kernel.org, Dickson Wong <dicksonwong@gmail•com>
Subject: Re: [PATCH] mergetool: reorder vim/gvim buffers in three-way diffs
Date: Fri, 29 Jan 2016 10:45:08 -0800	[thread overview]
Message-ID: <xmqq1t90jkcr.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1454033894-49954-1-git-send-email-dicksonwong@gmail.com> (Dickson Wong's message of "Thu, 28 Jan 2016 18:18:14 -0800")

Dickson Wong <dicksonwong@gmail•com> writes:

> When invoking default (g)vimdiff three-way merge, the merged file is
> loaded as the first buffer but moved to the bottom as the fourth window.
> This causes a disconnect between vim commands that operate on window
> positions (e.g. CTRL-W_w) and those that operate on buffer index (e.g.
> do/dp).
>
> This change reorders the buffers to have the same index as windows while
> keeping the cursor default to the merged result as the bottom window.
>
> Signed-off-by: Dickson Wong <dicksonwong@gmail•com>
> ---

David, I unfortunately do not use 'mergetools' myself and certainly
not vimdiff.

Opinions?

>  mergetools/vimdiff | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mergetools/vimdiff b/mergetools/vimdiff
> index 1ddfbfc..74ea6d5 100644
> --- a/mergetools/vimdiff
> +++ b/mergetools/vimdiff
> @@ -2,22 +2,22 @@ diff_cmd () {
>  	"$merge_tool_path" -R -f -d \
>  		-c 'wincmd l' -c 'cd $GIT_PREFIX' "$LOCAL" "$REMOTE"
>  }
>  
>  merge_cmd () {
>  	touch "$BACKUP"
>  	case "$1" in
>  	gvimdiff|vimdiff)
>  		if $base_present
>  		then
> -			"$merge_tool_path" -f -d -c 'wincmd J' \
> -				"$MERGED" "$LOCAL" "$BASE" "$REMOTE"
> +			"$merge_tool_path" -f -d -c '4wincmd w | wincmd J' \
> +				"$LOCAL" "$BASE" "$REMOTE" "$MERGED"
>  		else
>  			"$merge_tool_path" -f -d -c 'wincmd l' \
>  				"$LOCAL" "$MERGED" "$REMOTE"
>  		fi
>  		;;
>  	gvimdiff2|vimdiff2)
>  		"$merge_tool_path" -f -d -c 'wincmd l' \
>  			"$LOCAL" "$MERGED" "$REMOTE"
>  		;;
>  	gvimdiff3|vimdiff3)

  reply	other threads:[~2016-01-29 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  2:18 [PATCH] mergetool: reorder vim/gvim buffers in three-way diffs Dickson Wong
2016-01-29 18:45 ` Junio C Hamano [this message]
2016-02-09 22:25   ` Junio C Hamano
2016-02-10 14:40     ` Michael J Gruber
2016-02-10 17:45       ` Junio C Hamano
2016-02-11 15:44         ` Michael J Gruber
2016-02-11 16:03           ` Junio C Hamano
2016-02-11 19:24             ` Dickson Wong
2016-02-11 19:31               ` Junio C Hamano
2016-02-11 20:10                 ` Dickson Wong
2016-02-11 21:15             ` David Aguilar
2016-02-12 18:15               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1t90jkcr.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=davvid@gmail$(echo .)com \
    --cc=dicksonwong@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox