Skip to content

feat: wrap prose files in lf-diff by default - #3176

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-3173
Oct 19, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-3173

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Markdown and plain-text hunks now wrap within the diff reader. Code files keep horizontal scrolling, and page authors can set overflow="wrap" or overflow="scroll" on lf-diff for the whole patch. The prior row-fill width forced even Pierre's wrapped lines to remain wider than the reader; wrapped files now use the reader width while scrolling files retain their full-line change fill.

The browser regression test failed before the change because overflow was rejected by page validation, then verified the four reading modes and a line comment on wrapped prose. Focused diff layout and print tests, the corpus vocabulary check, and pnpm run check pass.

Closes #3173 — automated triage

Expose an overflow choice for patches whose code lines need wrapping or whose prose should keep horizontal scrolling. Let wrapped files use the reader width instead of the scrolling row fill width, so Pierre can actually break their lines.

Closes #3173
@leaf-agent
leaf-agent merged commit d9f5a36 into main Oct 19, 2026
4 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-3173 branch October 19, 2026 21:34
leaf-agent added a commit that referenced this pull request Oct 20, 2026
The three inline patches added to the diff gallery in #3176 ended with
indentation before `</pre>`. Leaf preserves trailing whitespace in a
patch because a space can be a context line, so Pierre read the
indentation as extra hunk content and refused each patch. The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/39336757143) caught
all three while surveying the generated corpus.

Place each closing tag at the start of its line and regenerate the
corpus. The existing
`test_unchanged_margin_passes_over_the_corpus_do_bounded_work_and_write_nothing`
failed with these parse errors before the edit and passed after it. The
patch still keeps meaningful trailing whitespace in its source; the
example now supplies a valid hunk.

Co-authored-by: leaf-agent <[email protected]>
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.

lf-diff can't wrap long lines, so Markdown hunks run off the right edge

1 participant