Documentation
¶
Index ¶
- type DiffView
- func (dv *DiffView) After(path, content string) *DiffView
- func (dv *DiffView) Before(path, content string) *DiffView
- func (dv *DiffView) ChromaStyle(style *chroma.Style) *DiffView
- func (dv *DiffView) ContextLines(contextLines int) *DiffView
- func (dv *DiffView) Height(height int) *DiffView
- func (dv *DiffView) InfiniteYScroll(infiniteYScroll bool) *DiffView
- func (dv *DiffView) LineNumbers(lineNumbers bool) *DiffView
- func (dv *DiffView) Split() *DiffView
- func (dv *DiffView) String() string
- func (dv *DiffView) Style(style Style) *DiffView
- func (dv *DiffView) TabWidth(tabWidth int) *DiffView
- func (dv *DiffView) Unified() *DiffView
- func (dv *DiffView) Width(width int) *DiffView
- func (dv *DiffView) XOffset(xOffset int) *DiffView
- func (dv *DiffView) YOffset(yOffset int) *DiffView
- type LineStyle
- type Style
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffView ¶
type DiffView struct {
// contains filtered or unexported fields
}
DiffView represents a view for displaying differences between two files.
func (*DiffView) ChromaStyle ¶
ChromaStyle sets the chroma style for syntax highlighting. If nil, no syntax highlighting will be applied.
func (*DiffView) ContextLines ¶
ContextLines sets the number of context lines for the DiffView.
func (*DiffView) InfiniteYScroll ¶
InfiniteYScroll allows the YOffset to scroll beyond the last line.
func (*DiffView) LineNumbers ¶
LineNumbers sets whether to display line numbers in the DiffView.
func (*DiffView) TabWidth ¶
TabWidth sets the tab width. Only relevant for code that contains tabs, like Go code.
type Style ¶
type Style struct {
DividerLine LineStyle
MissingLine LineStyle
EqualLine LineStyle
InsertLine LineStyle
DeleteLine LineStyle
}
Style defines the overall style for the diff view, including styles for different line types such as divider, missing, equal, insert, and delete lines.
func DefaultDarkStyle ¶
func DefaultDarkStyle() Style
DefaultDarkStyle provides a default dark theme style for the diff view.
func DefaultLightStyle ¶
func DefaultLightStyle() Style
DefaultLightStyle provides a default light theme style for the diff view.