Repository navigation
Widen --wide by the five columns lf-diff's second line-number column added - #5686
Merged
Merged
Conversation
--wide is the width at which 100 columns of code read unwrapped beside a diff's gutter at four-digit line numbers, and tokens.css derives it from that gutter's anatomy. #5611 numbered a diff's old and new lines in separate columns, so the gutter grew from digits + 5 to 2 x digits + 6 characters, and the 100-column line in test_named_wide_is_the_evidence_width_of_a_document_layout scrolled by 29px. The derivation now counts 114 characters, so a wide block on a document page is about 5 code characters wider at a large window. Refs #5658
leaf-agent
commented
Nov 7, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
The width is right: lf-diff.js sets --lf-diff-gutter to 2 * digits + 4 ch, and widget-shadow.css starts the text at gutter + 2ch, so four-digit numbers give 114 columns. The claimed journey fails with main's tokens.css (assert 29 <= 0) and passes here. One fix to the comment is inline; I'll push it.
geometry.css holds only the diff's vertical anatomy; the gutter's 2 × digits + 6 comes from lf-diff.js and widget-shadow.css. Comment only; no behavior changes.
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.
--wideis the width at which 100 columns of code read without wrapping beside a diff's gutter with four-digit line numbers, andtokens.cssderives it from that gutter's width. #5611 numbered a diff's old and new lines in separate columns, which grew the gutter fromdigits + 5to2 × digits + 6characters. The derivation still counted 109 characters, so the 100-column line intest_named_wide_is_the_evidence_width_of_a_document_layoutscrolled 29px sideways. It now counts 114.On screen. On document pages at windows wide enough for the cap, every block that names
wideis about 41px wider (5 × 0.61 × 13.5px). That covers diffs and anydata-width="wide"block. Workspaces and narrow windows don't change. Inleaf-dev stills --state diff-long-lines, the diff gallery's actions move from 870.6px to 911.8px, and each wrapped line holds a few more characters:Before:

After:

The other choice was to leave the width alone and accept 95 columns at four-digit line numbers. That would break the rule
tokens.cssstates for--wide. #5611 meant to number both files, not to narrow the readable code, so this PR keeps the rule.The journey fails on main
02a1e05cband passes on this branch.Refs #5658 — automated triage