Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmphasizeChanges ¶ added in v0.75.0
EmphasizeChanges gives the changed words in each block of removed and added lines a stronger background, like the inline highlights in editor diff views. lines and kinds are parallel; lines is updated in place.
Types ¶
type SourceLine ¶
SourceLine identifies a line in one version of a file. Number is one-based.
type Span ¶
type Span struct {
Text string
Foreground color.Color
Bold bool
Italic bool
Underline bool
Background color.Color
}
Span is terminal-safe source text with optional syntax attributes.
type SpanLine ¶
type SpanLine []Span
SpanLine is one highlighted source line, split at syntax token boundaries.
func HighlightDiff ¶
func HighlightDiff(path string, oldLines, newLines []SourceLine) (old, new []SpanLine)
HighlightDiff highlights the old and new versions independently, keeping syntax context across hunks of the same version.