mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 22:16:22 -04:00
The diff-line primitive (recover a rendered row's patch-space identity) is about to gain a second, inverse consumer: the escape restore scans a focused main view's rows as it re-renders, looking for the row that matches a target patch identity. That scan runs over the *loading* off-screen buffer, not the displayed view, so the resolver can't be tied to the displayed view's per-view-line readers. Pull the three backends (OSC metadata, buffer parse, lazygit-edit hyperlink) onto a single buffer-agnostic resolver that takes a snapshot of a diff's per-line content — text, metadata and hyperlink per unwrapped buffer line — and the line to resolve. The forward consumers (click/enter/edit/PR) feed it a snapshot of the displayed buffer (gocui.DiffLineContents) after mapping the wrapped view line to its buffer line; the upcoming scan will feed it the off-screen buffer's loaded rows. Behavior is unchanged.