Skip to content

Feature: disable line matching in split diffs #781

Open

Description

@barrettruth

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'.

Activity

  1. added
    enhancement
    on Jun 5, 2026
  2. amadeus commented on Jun 8, 2026

    @amadeus
    Member

    Interesting, wouldn't unified essentially be a better way to run this flow if additions/deletions aren't side-by-side?

  3. barrettruth commented on Jun 8, 2026

    @barrettruth
    Author

    Yes - if by that you mean there's a bunch of empty column-space in the cases where there's a bunch of non side-by-side diffs.

    It just provides some clarity in the cases where there are.

    Thanks for the response, not sure how to help here 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    diffsenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions