git/list[1] front-page[2] threads[3] people[4] search[5] about
 

vimdiff mergetool diff mode detection in vimrc broken by commit 0041797449

From
AOAndrew Oates <andrew@andrewoates.com>
Date
Jul 12, 2022, 00:06 UTC
Message-ID
<CAAVLcG42wom6Rf=6YZoc+iUnXDxshBfGOjqQPryGkzXxRxb-hA@mail.gmail.com>
Hi all,

I believe commit 0041797449da61f4131bb1673fa5d4c3af48240d ("vimdiff: new implementation with layout support") broke the ability to detect diff mode in a .vimrc, because it removed '-d' from the command line use to invoke vim ('&diff' evaluates to false, because diffmode isn't enabled until the commands are run, which happens _after_ vimrc is executed AFAICT). I check &diff in my vimrc to set various settings specifically when doing a diff/merge.

Just adding '-d' back breaks the layouts unfortunately. I can hack around this with a heuristic that looks for a mergetool-like invocation, but ideally there would be a way to set the canonical diff setting correctly. It may be as simple as adding some extra commands to close the extra windows opened by adding '-d'.

Thoughts?

Cheers, Andrew

Next: Fernando Ramos
Message 1 of 2 in “vimdiff mergetool diff mode detection in vimrc broken by commit 0041797449”
  1. Andrew OatesJul 12, 2022
  2. Fernando RamosJul 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.