git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Fernando Ramos <greenfoo@u92.eu>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/2] mergetools: vimdiff3: fix regression
Date: Sat, 6 Aug 2022 12:53:24 -0500	[thread overview]
Message-ID: <CAMP44s1uPFGYVJ7dzf1pFXENnUjTTwxHye2iT_HPNiMcmPjD9A@mail.gmail.com> (raw)
In-Reply-To: <Yu6V4cIajhoMhB3t@zacax395.localdomain>

Hello,

On Sat, Aug 6, 2022 at 11:25 AM Fernando Ramos <greenfoo@u92.eu> wrote:
> On 22/08/02 04:41PM, Felipe Contreras wrote:

> > I wrote vimdiff3 to leverage both the power of git's diff3 and vim's
> > diff mode, but commit 0041797449 broke that.

> By default this option is *not* set, which means buffers are discarded when
> hidden (and that's why diff colors dissapear). By setting this option colors are
> back even with '-u NONE':
>
>     vim -u NONE -c "echo | set hidden | 4b | bufdo diffthis" -c "tabfirst" LOCAL BASE REMOTE MERGED
>                            ^^^^^^^^^^

Correct.

> Regarding (2) we can remove the "Press ENTER" message by adding "silent" to both
> "4b" and "bufdo", like this:
>
>     vim -u NONE -c "echo | set hidden | silent 4b | silent bufdo diffthis" -c "tabfirst" LOCAL BASE REMOTE MERGED
>                                         ^^^^^^      ^^^^^^

Correct.

> So... by making two changes to the current implementation (adding "set hidden"
> and "silent") we can make it work. The nice thing is that, this way, "vimdiff3"
> does not need to be treated as an exception and thus it will be (hopefully)
> easier to maintain.
>
> What do you think? :)

This could work. The result is not quite the same as with vimdiff, but
the difference is minimal.

Two observations though.

1. The "silent 4b" is ignored, since bufdo makes the last buffer the
current buffer, so if you want a different buffer you have to make the
switch *after* bufdo.

2. You probably want to do "set hidden" on all the modes.

I don't see the need for all this complexity for this simple mode, but
anything that actually works is fine by me.

Cheers.

-- 
Felipe Contreras

  parent reply	other threads:[~2022-08-06 17:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 21:41 [PATCH 0/2] mergetools: vimdiff3: fix regression Felipe Contreras
2022-08-02 21:41 ` [PATCH 1/2] mergetools: vimdiff3: make it work as intended Felipe Contreras
2022-08-02 21:41 ` [PATCH 2/2] mergetools: vimdiff3: fix diffopt options Felipe Contreras
2022-08-06 16:25 ` [PATCH 0/2] mergetools: vimdiff3: fix regression Fernando Ramos
2022-08-06 16:27   ` Fernando Ramos
2022-08-06 17:53   ` Felipe Contreras [this message]
2022-08-06 18:29     ` Fernando Ramos
2022-08-06 18:37       ` [PATCH] vimdiff: fix 'vimdiff3' behavior (colors + no extra key press) Fernando Ramos
2022-08-06 19:39         ` Felipe Contreras
2022-08-06 21:26           ` Fernando Ramos
2022-08-06 21:30             ` Fernando Ramos
2022-08-07  0:55               ` Felipe Contreras
2022-08-06 19:17       ` [PATCH 0/2] mergetools: vimdiff3: fix regression Felipe Contreras
2022-08-06 21:23         ` Fernando Ramos
2022-08-07  0:44           ` Felipe Contreras

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=CAMP44s1uPFGYVJ7dzf1pFXENnUjTTwxHye2iT_HPNiMcmPjD9A@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).