Skip to content

Fix diff lines that were never rendered - #10

Merged
patriksvensson merged 1 commit into
mainfrom
fix-hidden-diff-lines
Jul 22, 2026
Merged

Fix diff lines that were never rendered#10
patriksvensson merged 1 commit into
mainfrom
fix-hidden-diff-lines

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Fixes #7

Four defects caused changes to be silently omitted from the review output:

  • Empty lines rendered as nothing. The word wrap calculation produced a piece count of zero for empty text, so the render loop never ran and an added or removed blank line was invisible.
  • The last line of a snapshot could never render, because the range Stop is exclusive but was clamped to New.Count - 1.
  • Changes running to the end of a snapshot were dropped entirely. Ranges were only flushed upon encountering a following unchanged line, so a change with no trailing unchanged line was never emitted.
  • Line numbers drifted after the first insertion or deletion, since both columns used the index into the aligned diff rather than the position of each side within its own snapshot.

Fixes #7

Four defects caused changes to be silently omitted from the review output:

- Empty lines rendered as nothing. The word wrap calculation produced a
  piece count of zero for empty text, so the render loop never ran and an
  added or removed blank line was invisible.
- The last line of a snapshot could never render, because the range Stop
  is exclusive but was clamped to New.Count - 1.
- Changes running to the end of a snapshot were dropped entirely. Ranges
  were only flushed upon encountering a following unchanged line, so a
  change with no trailing unchanged line was never emitted.
- Line numbers drifted after the first insertion or deletion, since both
  columns used the index into the aligned diff rather than the position
  of each side within its own snapshot.
@SimonCropp SimonCropp added this to the 0.8.1 milestone Jul 22, 2026

@patriksvensson patriksvensson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@patriksvensson
patriksvensson merged commit 3973cce into main Jul 22, 2026
2 checks passed
@patriksvensson
patriksvensson deleted the fix-hidden-diff-lines branch July 22, 2026 19:13
@SimonCropp
SimonCropp restored the fix-hidden-diff-lines branch July 30, 2026 13:40
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.

Line additions / removal are not shown

2 participants