jesseduffield.lazygit/pkg
Stefan Haller 00df5177e5 gocui: parse OSC 456 per-line diff metadata and attach it per cell
A patched pager (delta) prefixes each diff line with an OSC 456 sequence
carrying that line's patch-space identity (see diff-line-metadata-notes.md),
so the host can map a rendered row back to (file, type, new-line, old-line)
without re-parsing -- the only way to recover the side for renderings that
drop the +/- markers (delta's default mode).

Recognize it in the escape interpreter and stamp the payload onto each cell,
mirroring how OSC-8 hyperlinks are handled, exposing it via
DiffLineMetadataInLine. To do so, generalize the OSC dispatch to accumulate
the (possibly multi-digit) OSC number before branching, rather than matching
the single character '8'; the OSC-8 path is unchanged for well-formed input.

Unlike a hyperlink, the metadata sequence is never closed -- the pager
re-emits one per line -- so clear it at each line boundary to keep it from
bleeding onto a following line that has none (e.g. a hunk header).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-08 12:58:59 +02:00
..
app Recognize a repo that has no work tree instead of bailing out 2026-08-08 11:15:01 +02:00
cheatsheet Render every key for a binding in the cheatsheet 2026-05-25 15:18:18 +02:00
commands Recover diff-line identity by parsing the buffer, behind a swappable seam 2026-08-08 12:58:59 +02:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Replace gui.showSelectionInFocusedMainView config with on-demand selection 2026-08-08 12:58:59 +02:00
constants Adapt links 2026-07-31 08:42:51 +02:00
env Remember how to get back to a repo we entered a submodule from 2026-08-08 11:15:01 +02:00
fakes Modernize all codes 2025-11-15 10:46:23 +01:00
gocui gocui: parse OSC 456 per-line diff metadata and attach it per cell 2026-08-08 12:58:59 +02:00
gui Recover diff-line identity by parsing the buffer, behind a swappable seam 2026-08-08 12:58:59 +02:00
i18n Replace gui.showSelectionInFocusedMainView config with on-demand selection 2026-08-08 12:58:59 +02:00
integration Honor the conflict-marker-size gitattribute 2026-08-08 12:43:42 +02:00
jsonschema Fold legacy quit-alt1 into the multi-key quit binding 2026-05-25 15:32:47 +02:00
logs Fix Windows linter errors 2026-06-16 16:21:13 +02:00
snake Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
tasks Let a cmd/pty task restore a saved scroll position at its first paint 2026-08-08 12:58:59 +02:00
theme Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Make StringStack generic 2026-08-08 11:15:01 +02:00