Versions in this module Expand all Collapse all v0 v0.1.1 Jul 27, 2026 Changes in this version + const SpaceChar + const TabChar + const TrailingSpaceStr + var ErrPathEscapesBase = errors.New("path escapes its base directory") + func CompareDirectories(leftDir, rightDir string) (string, error) + func ComputeHunkWordDiffs(hunk *Hunk) map[int]WordDiffResult + func CountTrailingWhitespace(content string) int + func GeneratePatch(files []FileChange, selection SelectionState) string + func GeneratePatchForTag(files []FileChange, selection SelectionState) string + func GetLeadingWhitespace(content string) string + func GetSelectedHunksMap(files []FileChange, selectionState interface{ ... }) map[string]map[int]bool + func GetUnselectedFiles(files []FileChange, selection SelectionState) []string + func HasTrailingWhitespace(content string) bool + func IsWhitespaceOnlyChange(oldContent, newContent string) bool + func RenderWhitespaceSimple(content string, tabWidth int) string + func SelectAll(files []FileChange, selection interface{ ... }) + type Applier struct + LeftDir string + RightDir string + func NewApplier(leftDir, rightDir string) *Applier + func (a *Applier) ApplySelections(files []FileChange, selection SelectionState) error + type ChangeType int + const ChangeTypeAdded + const ChangeTypeDeleted + const ChangeTypeModified + const ChangeTypeRenamed + func (ct ChangeType) String() string + type DiffSource interface + GetDiff func() (string, error) + GetSourceLabel func() string + SupportsRevisions func() bool + type DirectorySource struct + LeftPath string + RightPath string + func NewDirectorySource(leftPath, rightPath string) *DirectorySource + func (s *DirectorySource) GetDiff() (string, error) + func (s *DirectorySource) GetSourceLabel() string + func (s *DirectorySource) SupportsRevisions() bool + type FileChange struct + ChangeType ChangeType + Hunks []Hunk + Path string + func Parse(diffText string) []FileChange + func (fc *FileChange) AddedLines() int + func (fc *FileChange) DeletedLines() int + func (fc *FileChange) TotalLines() int + type Hunk struct + Header string + Lines []Line + NewLines int + NewStart int + OldLines int + OldStart int + type IntraLineSpan struct + End int + Start int + Text string + Type SpanType + type Line struct + Content string + NewLineNum int + OldLineNum int + Type LineType + func ProcessHunkHideWhitespace(lines []Line) []Line + type LinePair struct + NewLine *Line + NewLineIdx int + OldLine *Line + OldLineIdx int + func FindLinePairs(hunk *Hunk) []LinePair + type LineType int + const LineAddition + const LineContext + const LineDeletion + func (lt LineType) String() string + type RevisionSource struct + Client *jj.Client + Revision string + func NewRevisionSource(client *jj.Client, revision string) *RevisionSource + func (s *RevisionSource) GetDiff() (string, error) + func (s *RevisionSource) GetSourceLabel() string + func (s *RevisionSource) SupportsRevisions() bool + type SelectionState interface + HasPartialSelection func(filePath string, hunkIdx int) bool + IsHunkSelected func(filePath string, hunkIdx int) bool + IsLineSelected func(filePath string, hunkIdx, lineIdx int) bool + type SpanType int + const SpanAdded + const SpanDeleted + const SpanEqual + type WhitespaceRenderer struct + func NewWhitespaceRenderer(tabWidth int, trailingHighlight lipgloss.Style) *WhitespaceRenderer + func (r *WhitespaceRenderer) Render(content string) string + type WordDiffResult struct + NewSpans []IntraLineSpan + OldSpans []IntraLineSpan + func ComputeWordDiff(oldLine, newLine string) WordDiffResult