Documentation
¶
Overview ¶
Package dmp provides an diffutils.InlineHighlighter implementation using Google's diff-match-patch algorithm (via sergi/go-diff) for character-level inline diff highlighting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Highlighter ¶
type Highlighter struct {
// contains filtered or unexported fields
}
Highlighter implements diffutils.InlineHighlighter using diff-match-patch for character-level diffs between two lines.
func NewHighlighter ¶
func NewHighlighter(args *HighlighterArgs) *Highlighter
NewHighlighter creates a Highlighter with optional configuration.
func (*Highlighter) HighlightInline ¶
func (h *Highlighter) HighlightInline(oldLine, newLine string) (oldResult, newResult string)
HighlightInline returns old and new lines with ANSI escape sequences marking deleted and inserted characters respectively.
type HighlighterArgs ¶
type HighlighterArgs struct {
// DeletedColor is the ANSI color code for deleted characters (default: red "31").
DeletedColor string
// InsertedColor is the ANSI color code for inserted characters (default: green "32").
InsertedColor string
}
HighlighterArgs holds configuration for NewHighlighter.
Click to show internal directories.
Click to hide internal directories.