Documentation
¶
Overview ¶
Package unified renders AST-aware unified diffs.
Package unified renders AST-aware unified diffs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RenderOptions ¶
type RenderOptions struct {
// Color turns ANSI styling on or off.
Color bool
// ContextLines sets how many surrounding lines to show (default: 3).
ContextLines int
// LineNumbers shows source and destination line numbers in the gutter.
LineNumbers bool
// DisableAnnotations hides AST move and shift badges from line output.
DisableAnnotations bool
// SuppressHunkFallbackAnnotation stops hunk headers from repeating the fallback tag when the file banner already shows it.
SuppressHunkFallbackAnnotation bool
// Wrap enables soft line wrapping to fit the terminal width.
Wrap bool
// TerminalWidth is the wrap boundary (0 to auto-detect from the terminal).
TerminalWidth int
// TabWidth sets spaces per tab stop (default: 4).
TabWidth int
// SrcLabel is an optional label appended to the source file header.
SrcLabel string
// DstLabel is an optional label appended to the destination file header.
DstLabel string
// ShowStyleChanges displays changes that only differ in whitespace or formatting.
ShowStyleChanges bool
}
RenderOptions controls how we render the unified diff.
Click to show internal directories.
Click to hide internal directories.