Documentation
¶
Overview ¶
Package diffview renders unified diffs from `gh pr diff` in a TUI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
File is one file's worth of changes from a unified diff.
type Highlighter ¶
type Highlighter struct {
// contains filtered or unexported fields
}
Highlighter colorizes diff content lines using chroma based on file extension. Lexers and the formatter are looked up once per extension and reused. When NO_COLOR is set or the lexer is unknown, Highlight returns the input unchanged.
func NewHighlighter ¶
func NewHighlighter() *Highlighter
func (*Highlighter) Highlight ¶
func (h *Highlighter) Highlight(path, src string) string
Highlight returns the colorized form of src for the lexer matching path's extension. Falls back to src on any error or when disabled.
type Line ¶
Line is one rendered line of the diff (file header, hunk header, or content). Kind drives coloring; Text is the raw text without trailing newline.