Skip to content

fix(native): start a diff's highlighting over at each collapsed stretch - #926

Merged
omartelo merged 2 commits into
mainfrom
fix/diff-highlight-across-gaps
Oct 23, 2026
Merged

omartelo merged 2 commits into
mainfrom
fix/diff-highlight-across-gaps

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

In Review and Pulls, a block comment opened above a collapsed stretch of a diff, whose */ fell in the hidden lines, colored every hunk below as a comment until some later */. Expanding the stretch was the only way out.

godemirror highlighted all the rows on screen as one text. v0.8.1 (lichdotdev/godemirror#5) highlights the rows between gaps on their own. This PR bumps the pin in both go.mod files and adds the CHANGELOG entry.

What is left: the lines of a comment cut by a collapsed stretch, above it, can show as code until it is expanded, and in unified view deleted and added rows are still parsed together. Highlighting the whole old and new files is tracked in lichdotdev/godemirror#4.

Test plan

  • godemirror TestAGapEndsWhatItsHunkLeftOpen (unified and split) fails on v0.8.0 and passes on v0.8.1
  • gofmt -l . and go vet ./... at the root and in native/
  • go test ./... in native/ and go test ./internal/themes/ (the one backend package importing godemirror)

Bumps godemirror to v0.8.1, whose DiffView highlights the rows between gaps
on their own: a block comment closed in the hidden lines no longer runs on
through the hunks below.
@omartelo
omartelo merged commit 8af20b7 into main Oct 23, 2026
7 checks passed
@omartelo
omartelo deleted the fix/diff-highlight-across-gaps branch October 23, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant