From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Fernando Ramos <greenfoo@u92.eu>
Subject: Re: [PATCH v3 7/7] mergetools: vimdiff: restore selective diff mode
Date: Mon, 8 Aug 2022 20:08:16 -0500 [thread overview]
Message-ID: <CAMP44s2RsvXnt8LtDcv+Ai_kCxmtURGWXmwfchO08dhjMxkGhA@mail.gmail.com> (raw)
In-Reply-To: <20220809004549.123020-8-felipe.contreras@gmail.com>
On Mon, Aug 8, 2022 at 7:46 PM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> Apparently some people want the diff mode to show differences only on
> the visible windows, so turn this on only when the tab has more than one
> window.
> @@ -323,8 +323,20 @@ gen_cmd () {
> IFS=+
> for tab in $LAYOUT
> do
> - test -n "$CMD" && CMD="$CMD | tabnew | silent execute 'bufdo diffthis'"
> - CMD=$(gen_cmd_aux "$tab" "$CMD")
> + if echo "$tab" | grep ",\|/" >/dev/null
> + then
> + test -n "$CMD" && CMD="$CMD | tabnew"
> + CMD=$(gen_cmd_aux "$tab" "$CMD")
> + CMD="$CMD | execute 'windo diffthis'"
> + else
> + if test -z "$CMD"
> + then
> + CMD="silent execute 'bufdo diffthis'"
> + else
> + CMD="$CMD | tabnew | silent execute 'bufdo diffthis'"
> + fi
> + CMD=$(gen_cmd_aux "$tab" "$CMD")
> + fi
> done
> IFS=$oldIFS
>
Notice that after reorganizing the tab handling my layout becomes really simple:
set hidden diffopt-=hiddenoff | silent execute 'bufdo diffthis' | 4b
And your layout becomes:
set hidden diffopt-=hiddenoff | echo | leftabove vertical split | 2b
| wincmd l | 1b | execute 'windo diffthis' | tabnew | leftabove
vertical split | 2b | wincmd l | 3b | execute 'windo diffthis'
So this "works" too, right?
Cheers.
--
Felipe Contreras
next prev parent reply other threads:[~2022-08-09 1:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-09 0:45 [PATCH v3 0/7] mergetools: vimdiff: regression fixes and improvements Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 1/7] mergetools: vimdiff: fix comment Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 2/7] mergetools: vimdiff: make vimdiff3 actually work Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 3/7] mergetools: vimdiff: silence annoying messages Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 4/7] mergetools: vimdiff: fix for diffopt Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 5/7] mergetools: vimdiff: fix single window layouts Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 6/7] mergetools: vimdiff: rework tab logic Felipe Contreras
2022-08-09 0:45 ` [PATCH v3 7/7] mergetools: vimdiff: restore selective diff mode Felipe Contreras
2022-08-09 1:08 ` Felipe Contreras [this message]
2022-08-09 5:26 ` Fernando Ramos
2022-08-09 20:07 ` Felipe Contreras
2022-08-10 8:45 ` Junio C Hamano
2022-08-10 18:29 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMP44s2RsvXnt8LtDcv+Ai_kCxmtURGWXmwfchO08dhjMxkGhA@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=greenfoo@u92.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).