Versions in this module Expand all Collapse all v0 v0.1.0 Aug 22, 2025 Changes in this version + func ApplyCommit(commit Commit, writeFn func(string, string) error, removeFn func(string) error) error + func FormatDiff(diffText string, opts ...SideBySideOption) (string, error) + func GenerateDiff(beforeContent, afterContent, fileName string) (string, int, int) + func HighlightIntralineChanges(h *Hunk) + func IdentifyFilesAdded(text string) []string + func IdentifyFilesNeeded(text string) []string + func LoadFiles(paths []string, openFn func(string) (string, error)) (map[string]string, error) + func OpenFile(p string) (string, error) + func ProcessPatch(text string, openFn func(string) (string, error), ...) (string, error) + func RemoveFile(p string) error + func RenderSideBySideHunk(fileName string, h Hunk, opts ...SideBySideOption) string + func SyntaxHighlight(w io.Writer, source, fileName, formatter string, bg lipgloss.TerminalColor) error + func ValidatePatch(patchText string, files map[string]string) (bool, string, error) + func WriteFile(p string, content string) error + type ActionType string + const ActionAdd + const ActionDelete + const ActionUpdate + type Chunk struct + DelLines []string + InsLines []string + OrigIndex int + type Commit struct + Changes map[string]FileChange + func AssembleChanges(orig map[string]string, updatedFiles map[string]string) Commit + func PatchToCommit(patch Patch, orig map[string]string) (Commit, error) + type DiffError struct + func NewDiffError(message string) DiffError + func (e DiffError) Error() string + type DiffLine struct + Content string + Kind LineType + NewLineNo int + OldLineNo int + Segments []Segment + type DiffResult struct + Hunks []Hunk + NewFile string + OldFile string + func ParseUnifiedDiff(diff string) (DiffResult, error) + type FileChange struct + MovePath *string + NewContent *string + OldContent *string + Type ActionType + type Hunk struct + Header string + Lines []DiffLine + type LineType int + const LineAdded + const LineContext + const LineRemoved + type ParseConfig struct + ContextSize int + type ParseOption func(*ParseConfig) + func WithContextSize(size int) ParseOption + type Parser struct + func NewParser(currentFiles map[string]string, lines []string) *Parser + func (p *Parser) Parse() error + type Patch struct + Actions map[string]PatchAction + func TextToPatch(text string, orig map[string]string) (Patch, int, error) + type PatchAction struct + Chunks []Chunk + MovePath *string + NewFile *string + Type ActionType + type Segment struct + End int + Start int + Text string + Type LineType + type SideBySideConfig struct + TotalWidth int + func NewSideBySideConfig(opts ...SideBySideOption) SideBySideConfig + type SideBySideOption func(*SideBySideConfig) + func WithTotalWidth(width int) SideBySideOption