Skip to content

fix(compact): align zero-width hunk context - #512

Open
caenrique wants to merge 2 commits into
esmuellert:mainfrom
caenrique:fix/compact-zero-width-context
Open

fix(compact): align zero-width hunk context#512
caenrique wants to merge 2 commits into
esmuellert:mainfrom
caenrique:fix/compact-zero-width-context

Conversation

@caenrique

Copy link
Copy Markdown

Problem

Compact folds can be off by one after a zero-width hunk, so corresponding fold boundaries do not align between the two panes.

Solution

Handle zero-width ranges as boundaries when calculating visible context, and map the first folded line consistently between both sides.

Testing

Added compact-mode tests for zero-width context and fold alignment. The compact test suite passes.

Comment thread lua/codediff/ui/view/compact.lua Outdated
range_end = range_start + 1
end

-- A zero-width range is a boundary between unchanged lines. The formula

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The comments seem to be dead and should remove?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done in 053c99c

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.

2 participants