mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 14:06:32 -04:00
A diff renderer that restructures the diff — into columns, or with the +/- markers replaced by colour — leaves us no way to tell which line of which file a rendered row came from, which is what acting on the row requires. The OSC 1717 protocol has the renderer say so directly: it prefixes each line it renders with a record naming the file and the line's position in the old and new versions of it. Attach each record to the cells it precedes, so that a row's records survive wrapping and the columns of a side-by-side rendering, and hand them to readers together with the row's text: the two have to describe the same buffer, and a re-render can rebuild it between two reads. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>