Skip to content

feat: (cosmetic) nicer word wrap - #382

Merged
agavra merged 1 commit into
agavra:mainfrom
N4M3Z:feat-word-wrap
May 26, 2026
Merged

feat: (cosmetic) nicer word wrap#382
agavra merged 1 commit into
agavra:mainfrom
N4M3Z:feat-word-wrap

Conversation

@N4M3Z

@N4M3Z N4M3Z commented May 26, 2026

Copy link
Copy Markdown
Contributor

Wrap mode pre-expands long lines manually instead of delegating to Ratatui's Wrap. Continuation rows preserve the gutter structure so line numbers and diff markers stay aligned.

  42 ▌ let very_long_variable_name = some_func
   ↪ ▌ tion_call(argument_one, argument_two,
   ↪ ▌ argument_three);
  • Continuation rows show in the line-number column and preserve the diff origin marker () so add/del coloring stays consistent across wrapped visual rows.
  • Overlay painting (cursor highlight, visual selection, diff backgrounds) uses content-adjusted widths (viewport minus gutter) for row prediction, matching the pre-expansion break points exactly.
  • :wrap toggles wrap on/off (alias for the existing :set wrap!).

Test plan

  • cargo fmt && cargo clippy -- -D warnings clean
  • cargo test --lib passes (839 tests)
  • Manual: :wrap on a file with long lines shows ↪ ▌ on continuation rows, content aligned with original line
  • Manual: cursor-line highlight spans all visual rows of a wrapped line
  • Manual: visual selection (V) highlight tracks the cursor correctly on wrapped lines
  • Manual: toggling :wrap off restores horizontal scroll mode with no visual artifacts

@N4M3Z N4M3Z changed the title feat: gutter-aligned word wrap with continuation marker feat: (cosmetic) nicer word wrap May 26, 2026
Wrap mode pre-expands long lines manually instead of delegating to
Ratatui's Wrap. Continuation rows show a wrap arrow in the line-number
column and preserve the diff origin marker so add/del coloring stays
consistent. Overlay painting (cursor highlight, visual selection, diff
backgrounds) uses content-adjusted widths so all highlights track the
rendered text correctly.

`:wrap` toggles wrap on/off (alias for `:set wrap!`).
@N4M3Z
N4M3Z force-pushed the feat-word-wrap branch from 047cf27 to 8c5d3c9 Compare May 26, 2026 18:19
@N4M3Z

N4M3Z commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

That should be it from my side for now to use this as a daily driver, I might send some minor stuff but now I gotta actually start working ) Thanks for the quick responses on my PRs

@agavra
agavra merged commit f98df24 into agavra:main May 26, 2026
4 checks passed
@N4M3Z

N4M3Z commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

I just noticed the wrap is breaking words affecting readability, will submit a fix

@N4M3Z

N4M3Z commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

#385

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