fix: text-spacing in diff overlay and help menu#95
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Fixes two TUI spacing bugs:
{:>4}{:>4}) separated only by alignment padding, so a 5+ digit line number overflowed the field and the old/new numbers ran together as "one long digit." Added agutter_widthpre-scan that sizes both columns to the file's largest line number, and aformat_gutterhelper that always keeps a single-space separator. Narrow files stay compact; large files never collide.Ctrl+u / Ctrl+d,gg / G / Ctrl+u/d/f/b) exceed that and overflowed, breaking the description column. Now computes a global key-column width from the widest key by terminal display width (viafit::display_width, so arrow glyphs are measured correctly) plus a 2-column gap.Pure spacing — no new glyphs, colors, layout changes, or config options.
Test Plan
cargo test— 356 pass (10 new: 5format_gutter, 3gutter_width, 2 help alignment)cargo clippy --all-targets -- -D warnings— cleancargo build --release— succeeds?— all descriptions start at the same column, including the longest key rows🤖 Generated with Claude Code