mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
Where a renderer states which line of which file it is rendering, take that as the line's identity. The renderer knows, and for a rendering that no longer looks like a diff nothing else does. Reading the rendered text stays the way for the renderings that keep a diff's structure, and for the renderers that say nothing at all. Which of the two is used is settled for the rendering as a whole, not row by row. A rendering with records is not parsed at all, not even for the rows the renderer says nothing about. Its text is no unified diff, and a row of it can read like one. Under delta, a commit that adds a test whose input is a diff shows the test's "diff --git a/img.png b/img.png" line as a row of its own; parsed, that row opens a file section that runs to the end of the rendering, and every row delta puts between hunks and files comes out as a header of a file called img.png. So the untagged rows of such a rendering stay unresolved, as the protocol has it (spec section 6.4). Header records are accepted too. This lets a renderer point at a file with no content lines, such as a pure rename, a mode change or a binary file: for those files the header is the only row in the diff. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>