Conversation
There was a problem hiding this comment.
Pull request overview
Adds a word-wrap mode to the diff pane so long lines wrap at the viewport boundary (with ↪ continuation markers) instead of requiring horizontal scrolling, controllable via w and a new --wrap option.
Changes:
- Introduces
wrapMode(configurable via CLI/env/config) and awkey toggle that resets horizontal scroll and re-syncs the viewport. - Implements wrapped diff rendering (expanded + collapsed modes) with continuation markers and disables horizontal scroll while wrapping.
- Updates cursor/viewport math for wrapped visual rows and extends tests + documentation accordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
ui/model.go |
Adds wrapMode, config wiring, w toggle, horizontal scroll handler routing, status icon, and help text update. |
ui/model_test.go |
Adds extensive coverage for wrap config, icons, rendering, wrapping math, toggle behavior, scroll blocking, and help text. |
ui/diffview.go |
Implements core wrapping logic (wrapContent, wrapped rendering, line counting) and disables horizontal scroll during wrap. |
ui/collapsed.go |
Applies wrapping behavior to collapsed-mode add/modify lines and delete-only placeholders; shares placeholder text logic for math sync. |
ui/collapsed_test.go |
Adds collapsed-mode wrap rendering tests (markers, gutters, cursor placement, placeholder behavior). |
ui/annotate.go |
Updates cursorViewportY to account for wrapped visual rows and wrapped delete-only placeholders. |
cmd/revdiff/main.go |
Adds --wrap flag/env/config integration and wires it into ui.ModelConfig. |
cmd/revdiff/main_test.go |
Adds argument parsing coverage for --wrap via flag/env/config. |
README.md |
Documents wrap mode and the --wrap flag and keybinding. |
docs/plans/completed/20260402-word-wrap.md |
Marks implementation plan tasks as completed. |
CLAUDE.md |
Documents the wrap-mode rendering flow and cursor math adjustments. |
.claude-plugin/skills/revdiff/references/usage.md |
Adds w keybinding to usage reference. |
.claude-plugin/skills/revdiff/references/config.md |
Adds --wrap/REVDIFF_WRAP to config reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
wkey toggles word wrap in the diff pane — long lines wrap at the pane boundary with↪continuation markers instead of requiring horizontal scroll--wrapCLI flag and config file option to start with wrap enabled↩mode icon in status line when wrap is active (alongside▼collapsed and◉filter)←/→) disabled when wrap is active,scrollXreset to 0wkeybinding