Repository navigation
fix: start a diff's highlighting over at each gap - #5
Merged
Merged
Conversation
A block comment opened above a gap and closed in the lines it leaves out ran on as a comment through the following hunks, up to the next "*/" on screen. The rows between gaps are now highlighted on their own.
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A
DiffViewhighlighted all its rows as one text, gap separators included. A block comment opened above a gap and closed in the lines it leaves out ran on as a comment through every hunk below, up to the next*/on screen. Expanding the gap fixed the colors, since the*/then appeared.Now the rows between gaps are highlighted on their own (
highlightApart), using the separator rows as breaks. No exported API changes: the breaks ride an unexportedContentfield that onlyDiffViewsets.A diff with gaps is parsed from scratch each time instead of reparsed incrementally. Once every gap is filled it goes back to the incremental path.
The remaining limits (a comment cut by a gap colors as code above it; interleaved deleted and added rows in unified) are in
docs/ceilings.mdand tracked in #4.Test plan
TestAGapEndsWhatItsHunkLeftOpen(unified and split) fails without the fix and passes with itgofmt -l .,go vet ./...,go test ./...go test -race -count=50on the gap tests