diffview

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) 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.

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.

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.

Jump to

Keyboard shortcuts

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