Prerequisites
Proposal
Add an option to render split diffs without pairing deleted and added lines into the same row.
Proposed API:
splitLineMatching?: "paired" | "none"
Example patch:
@@ -1,2 +1,2 @@
const value = getOldValue()
-return oldValue + 1
+return getNewValue(input) + 1
Current paired split layout:
old new │ old side │ new side
2 2 │ - return oldValue + 1 │ + return getNewValue(input) + 1
With splitLineMatching: "none":
old new │ old side │ new side
2 │ - return oldValue + 1 │
2 │ │ + return getNewValue(input) + 1
Motivation and context
I can't exactly recall where I've seen this diffing mode, but I like it/use it. The closest precedent is Gitea/Forgejo. Gitea describes this as "matching up added and deleted lines" in split diffs, and moved that matching from client-side JS into the renderer in go-gitea/gitea#16775..
Diff2Html exposes a similar concept directly as matching: 'lines' | 'words' | 'none'.
Prerequisites
Proposal
Add an option to render split diffs without pairing deleted and added lines into the same row.
Proposed API:
Example patch:
Current paired split layout:
With splitLineMatching: "none":
Motivation and context
I can't exactly recall where I've seen this diffing mode, but I like it/use it. The closest precedent is Gitea/Forgejo. Gitea describes this as "matching up added and deleted lines" in split diffs, and moved that matching from client-side JS into the renderer in go-gitea/gitea#16775..
Diff2Html exposes a similar concept directly as
matching: 'lines' | 'words' | 'none'.