Skip to content

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

Closed

Description

@max-sixty

The "Diff controls" entry in TODO.md defers author-configurable wrapping until a page needs it. This is that page.

Use. A page explaining a code change whose most important hunks edit Markdown prose, where each paragraph is one long line.

What happened. lf-diff renders with overflow: "scroll" hardcoded in its OPTIONS, so each changed paragraph ran off the right edge, and reading one meant scrolling sideways line by line. The page instead quoted the key sentences in its own prose and left the diff collapsed below them. A long regular expression in a code hunk was cut off the same way.

Cost. For prose, the diff is the evidence a reviewer needs to read, and a page that has to restate it beside the diff carries two copies that can disagree.

Proposed shape. The vendored Pierre renderer already supports overflow: "wrap". Pass it through as an attribute on lf-diff, and wrap by default for prose files such as Markdown, where a line is a paragraph.

Seen on leaf 28c8d33, installed 2026-10-19T07:54:45-07:00.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    enhancement
    on Oct 19, 2026
  2. leaf-agent commented on Oct 19, 2026

    @leaf-agent
    Collaborator

    Fixed in #3176, now merged. Markdown and plain-text hunks wrap within the diff reader by default; code keeps sideways scrolling, and overflow="wrap" or overflow="scroll" sets one mode for the whole widget. The browser regression covers both defaults, both overrides, and commenting on a wrapped line. The PR checks passed on its final head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions