Skip to content

Config: soft wrap long diff lines#8

Open
carsonjones wants to merge 2 commits into
rockorager:mainfrom
carsonjones:feat/softwrap
Open

Config: soft wrap long diff lines#8
carsonjones wants to merge 2 commits into
rockorager:mainfrom
carsonjones:feat/softwrap

Conversation

@carsonjones
Copy link
Copy Markdown
Contributor

Summary

Adds opt-in soft wrapping of long diff lines via "wrap": true in ~/.config/comview/config.json (builds on #7).

  • Long lines fold at the terminal edge instead of requiring horizontal scroll
  • Horizontal scrollbar is hidden in wrap mode
  • Scroll, cursor visibility, and maxScroll accounting are all wrap-aware
  • Side-by-side mode is unaffected

How it works

  • wrappedDocRowHeight(docRow, viewportWidth) computes screen rows needed per doc row
  • printRowWrapped paints the gutter + first chunk on the first screen row, then continuation chunks on subsequent rows with background fill
  • rowDisplayHeightForSize, screenRowForDocRow, totalDisplayRowsForSize, and maxScrollForVisibleRows all use wrapped heights so scrolling stays accurate
  • scrollbarVisibility suppresses the horizontal scrollbar and uses total wrapped row count for the vertical scrollbar

Example config

{
  "wrap": true
}

🤖 Generated with Claude Code

@carsonjones carsonjones changed the title feat(tui): soft wrap long diff lines Config: soft wrap long diff lines May 18, 2026
…tion lines

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant