Skip to content

fold unified - #7

Merged
willmcgugan merged 12 commits into
mainfrom
mammal-fold
Apr 18, 2026
Merged

fold unified#7
willmcgugan merged 12 commits into
mainfrom
mammal-fold

Conversation

@willmcgugan

@willmcgugan willmcgugan commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Added wrap switch to wrap lines of code that don't fit within the available width, as an alternative to horizontal scroll.

  • Adding wrapping to unified view
  • Added wrapping to split view
  • Added line continuation symbol
SCR-20260418-lyvg SCR-20260418-lxyg
Screen.Recording.2026-04-18.at.13.24.15.mov

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds optional line-wrapping to DiffView (unified + split) to avoid horizontal scrolling, including a continuation glyph in the gutter, and updates snapshot coverage accordingly.

Changes:

  • Introduce wrap reactive switch and compose branches for wrapped unified/split rendering.
  • Add FoldedLineContent visual and gutter continuation construction.
  • Expand snapshot tests and recorded SVGs for wrapped modes (with/without annotations).

Reviewed changes

Copilot reviewed 3 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/textual_diff_view/_diff_view.py Adds wrap support, new FoldedLineContent visual, and wrapped compose paths for unified/split diff rendering.
examples/tdiff.py Adds w binding and binds wrap to the demo app / passes through to DiffView.load.
tests/test_snapshots.py Adds snapshot tests for wrapped unified/split modes and annotation combinations.
tests/__snapshots__/test_snapshots/test_diff_view_unified_wrap.svg New snapshot artifact for unified wrap mode.
tests/__snapshots__/test_snapshots/test_diff_view_unified_wrap_annotations.svg New snapshot artifact for unified wrap + annotations.
tests/__snapshots__/test_snapshots/test_diff_view_split_wrap.svg New snapshot artifact for split wrap mode.
tests/__snapshots__/test_snapshots/test_diff_view_unified.svg Updated snapshot due to styling/layout changes from wrap-related refactors.
tests/__snapshots__/test_snapshots/test_diff_view_unified_annotations.svg Updated snapshot due to styling/layout changes from wrap-related refactors.
tests/__snapshots__/test_snapshots/test_diff_view_annotations.svg Updated snapshot due to styling/layout changes from wrap-related refactors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/textual_diff_view/_diff_view.py Outdated
Comment thread src/textual_diff_view/_diff_view.py Outdated
Comment on lines +194 to +196
if line is None:
line = Content.styled("╲" * width, "$foreground 15%")
else:
Comment thread src/textual_diff_view/_diff_view.py Outdated
Comment thread src/textual_diff_view/_diff_view.py Outdated
Comment on lines +159 to +165
for annotate, continution, content, color, code_length in zip(
self.annotations,
self.continuations,
self.code_lines,
self.line_styles,
self.code_lengths,
):
Comment thread src/textual_diff_view/_diff_view.py
Comment thread src/textual_diff_view/_diff_view.py Outdated
@willmcgugan
willmcgugan merged commit 36f3ae5 into main Apr 18, 2026
12 checks passed
@willmcgugan
willmcgugan deleted the mammal-fold branch April 18, 2026 11:58
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