mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[PR #594] feat(core): show parent function/class context in diff hunk headers #1423
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1423
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/594
Author: @remorses
Created: 1/27/2026
Status: 🔄 Open
Base:
main← Head:contextual-lines📝 Commits (10+)
a30bee0contextual lineseb111a2change @@ positions4884fffuse only one @a71ecd4use context bg for hunk header rows, add contextual diff demo examplee82c433remove slop commentsc5d82d0fix contextual diff example with realistic function/method scopes535a725fix hunk line count in contextual diff exampleb05d420trimEnd inline snapshots0ef8c98Merge remote-tracking branch 'upstream/main' into contextual-lines6996765Merge remote-tracking branch 'upstream/main' into contextual-lines📊 Changes
4 files changed (+345 additions, -21 deletions)
View changed files
📝
packages/core/src/examples/diff-demo.ts(+52 -12)📝
packages/core/src/renderables/Diff.regression.test.ts(+2 -4)📝
packages/core/src/renderables/Diff.test.ts(+190 -0)📝
packages/core/src/renderables/Diff.ts(+101 -5)📄 Description
Parses the context text after
@@in unified diff hunk headers (e.g.@@ -10,5 +10,7 @@ function setup()) and renders it as a separator row between hunks. The@sign appears in the gutter column alongside+/-, and the function/class name appears in the content area with the same background as context lines.@@context text from raw diff string and attach to each hunk@@rows)@in the gutter sign column, context text in content areahunkHeaderFgoption for the@sign colorCloses #587
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.