diffview

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 New

func New() *DiffView

New creates a new DiffView with default settings.

func (*DiffView) After

func (dv *DiffView) After(path, content string) *DiffView

After sets the "after" file for the DiffView.

func (*DiffView) Before

func (dv *DiffView) Before(path, content string) *DiffView

Before sets the "before" file for the DiffView.

func (*DiffView) ChromaStyle

func (dv *DiffView) ChromaStyle(style *chroma.Style) *DiffView

ChromaStyle sets the chroma style for syntax highlighting. If nil, no syntax highlighting will be applied.

func (*DiffView) ContextLines

func (dv *DiffView) ContextLines(contextLines int) *DiffView

ContextLines sets the number of context lines for the DiffView.

func (*DiffView) Height

func (dv *DiffView) Height(height int) *DiffView

Height sets the height of the DiffView.

func (*DiffView) InfiniteYScroll

func (dv *DiffView) InfiniteYScroll(infiniteYScroll bool) *DiffView

InfiniteYScroll allows the YOffset to scroll beyond the last line.

func (*DiffView) LineNumbers

func (dv *DiffView) LineNumbers(lineNumbers bool) *DiffView

LineNumbers sets whether to display line numbers in the DiffView.

func (*DiffView) Split

func (dv *DiffView) Split() *DiffView

Split sets the layout of the DiffView to split (side-by-side).

func (*DiffView) String

func (dv *DiffView) String() string

String returns the string representation of the DiffView.

func (*DiffView) Style

func (dv *DiffView) Style(style Style) *DiffView

Style sets the style for the DiffView.

func (*DiffView) TabWidth

func (dv *DiffView) TabWidth(tabWidth int) *DiffView

TabWidth sets the tab width. Only relevant for code that contains tabs, like Go code.

func (*DiffView) Unified

func (dv *DiffView) Unified() *DiffView

Unified sets the layout of the DiffView to unified.

func (*DiffView) Width

func (dv *DiffView) Width(width int) *DiffView

Width sets the width of the DiffView.

func (*DiffView) XOffset

func (dv *DiffView) XOffset(xOffset int) *DiffView

XOffset sets the horizontal offset for the DiffView.

func (*DiffView) YOffset

func (dv *DiffView) YOffset(yOffset int) *DiffView

YOffset sets the vertical offset for the DiffView.

type LineStyle

type LineStyle struct {
	LineNumber lipgloss.Style
	Symbol     lipgloss.Style
	Code       lipgloss.Style
}

LineStyle defines the styles for a given line type in the diff view.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL