Versions in this module Expand all Collapse all v1 v1.0.0 Jan 7, 2026 Changes in this version + func All(lines iter.Seq[DiffLine], pred func(DiffLine) bool) bool + func Any(lines iter.Seq[DiffLine], pred func(DiffLine) bool) bool + func ChunkByOp(lines iter.Seq[DiffLine]) iter.Seq[[]DiffLine] + func CountLines(lines iter.Seq[DiffLine]) int + func FilteredLines(lines iter.Seq[DiffLine], pred func(DiffLine) bool) iter.Seq[DiffLine] + func ForEach(lines iter.Seq[DiffLine], fn func(DiffLine)) + func LinesInRange(lines iter.Seq[DiffLine], start, end int) iter.Seq[DiffLine] + func MapLines[T any](lines iter.Seq[DiffLine], fn func(DiffLine) T) iter.Seq[T] + func SelectedLines(lines iter.Seq[DiffLine], sel *FileSelection) iter.Seq[DiffLine] + func SkipLines(lines iter.Seq[DiffLine], n int) iter.Seq[DiffLine] + func TakeLines(lines iter.Seq[DiffLine], n int) iter.Seq[DiffLine] + func ZipWithIndex(lines iter.Seq[DiffLine]) iter.Seq2[int, DiffLine] + type DiffLine struct + Content string + NewLineNum int + OldLineNum int + Op LineOp + func CollectLines(lines iter.Seq[DiffLine]) []DiffLine + func FindFirst(lines iter.Seq[DiffLine], pred func(DiffLine) bool) (DiffLine, bool) + func (l DiffLine) EffectiveLineNum() int + func (l DiffLine) Format() string + func (l DiffLine) IsChange() bool + func (l DiffLine) LineRef() string + func (l DiffLine) String() string + type FileDiff struct + Hunks []*Hunk + IsBinary bool + IsDeleted bool + IsNew bool + IsRenamed bool + NewName string + OldName string + func (f *FileDiff) AllChanges() iter.Seq2[int, DiffLine] + func (f *FileDiff) AllHunks() iter.Seq2[int, *Hunk] + func (f *FileDiff) AllLines() iter.Seq2[int, DiffLine] + func (f *FileDiff) Format() string + func (f *FileDiff) HunkContainingLine(lineNum int) *Hunk + func (f *FileDiff) HunksInRange(start, end int) []*Hunk + func (f *FileDiff) Path() string + func (f *FileDiff) Stats() (added, deleted int) + type FileSelection struct + Path string + Ranges []LineRange + func ParseFileSelection(s string) (*FileSelection, error) + func ParseSelections(args []string) ([]*FileSelection, error) + func (fs *FileSelection) AllLines() []int + func (fs *FileSelection) Contains(lineNum int) bool + func (fs *FileSelection) Merge() + func (fs *FileSelection) String() string + type Hunk struct + Lines []DiffLine + NewLines int + NewStart int + OldLines int + OldStart int + Section string + func (h *Hunk) Additions() iter.Seq[DiffLine] + func (h *Hunk) All() iter.Seq[DiffLine] + func (h *Hunk) CanSplit() bool + func (h *Hunk) Changes() iter.Seq[DiffLine] + func (h *Hunk) ContainsLine(lineNum int) bool + func (h *Hunk) ContainsRange(start, end int) bool + func (h *Hunk) Deletions() iter.Seq[DiffLine] + func (h *Hunk) Header() string + func (h *Hunk) RecalculateLineCounts() + func (h *Hunk) Stats() (added, deleted int) + type LineOp int + const OpAdd + const OpContext + const OpDelete + func (op LineOp) Prefix() byte + func (op LineOp) String() string + type LineRange struct + End int + Start int + func (r LineRange) Contains(lineNum int) bool + func (r LineRange) String() string + type LineWithContext struct + File *FileDiff + GlobalIndex int + HunkIndex int + Line DiffLine + LineIndex int + type ParsedDiff struct + func Parse(diffText string) (*ParsedDiff, error) + func (d *ParsedDiff) AllFiles() []*FileDiff + func (d *ParsedDiff) FileByPath(path string) *FileDiff + func (d *ParsedDiff) FileCount() int + func (d *ParsedDiff) Files() iter.Seq[*FileDiff] + func (d *ParsedDiff) FilesWithIndex() iter.Seq2[int, *FileDiff] + func (d *ParsedDiff) LinesWithContext() iter.Seq[LineWithContext] + func (d *ParsedDiff) Stats() (added, deleted int) + type SelectionMap map[string]*FileSelection + func NewSelectionMap(selections []*FileSelection) SelectionMap + func (m SelectionMap) Contains(path string, lineNum int) bool + func (m SelectionMap) Get(path string) *FileSelection