Re: [PATCH v3 7/7] mergetools: vimdiff: restore selective diff mode
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Aug 9, 2022, 01:08 UTC
- Message-ID
- <CAMP44s2RsvXnt8LtDcv+Ai_kCxmtURGWXmwfchO08dhjMxkGhA@mail.gmail.com>
- 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.
Show 23 quoted lines
> @@ -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