Feature: disable line matching in split diffs
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 63/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by locating the split-diff renderer and tracing where deleted and added lines are paired into rows. Check how its rendering options are exposed, then add the proposed splitLineMatching option with "paired" and "none" modes. Done means the default layout stays paired and "none" renders deleted and added lines on separate rows as shown; run the relevant split-diff tests.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have searched for duplicate or closed feature requests
- I have read the contributing guidelines
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'.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 226
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pierrecomputer/pierre
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1187 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1150 · 3 comments ·
Maintainers usually reply within 1 day
-
Bug: WebKit crashes when drag-selecting text that auto-scrolls a diff (gutter-utility re-parented mid-drag)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
pierrecomputer/pierre#1184 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 63/100
pierrecomputer/pierre#1172 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 54/100
pierrecomputer/pierre#1171 · 2 comments ·
Maintainers usually reply within 1 day
All issues in pierrecomputer/pierre
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
siyuan-note/siyuan#20517 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pnpm/get.pnpm.io#68 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nuxt-modules/better-auth#578 · 2 comments ·
Maintainers usually reply within 1 day