Documentation
¶
Overview ¶
Package diff computes fast pure-Go line diffs (Myers SES) with rune-safe intraline change spans for real-time TUI and SSE visualization without spawning external git processes.
Index ¶
Constants ¶
View Source
const ( DefaultContextLines = 3 MaxDiffHunkLines = 400 MaxMyersWindowLines = 4000 MaxMyersEditDist = 1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffLine ¶
type DiffLine struct {
Kind LineKind `json:"k"`
OldLine int `json:"o,omitempty"`
NewLine int `json:"n,omitempty"`
Text string `json:"t"`
Spans []Span `json:"sp,omitempty"`
}
DiffLine represents a single line in a diff hunk.
type Hunk ¶
type Hunk struct {
OldStart int `json:"os"`
OldCount int `json:"oc"`
NewStart int `json:"ns"`
NewCount int `json:"nc"`
Lines []DiffLine `json:"lines"`
}
Hunk is one contiguous diff block with surrounding context lines.
Click to show internal directories.
Click to hide internal directories.