ui

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInteractive

func RunInteractive(allFiles, stagedFiles, unstagedFiles []parser.FileDiff, rendererOpts RendererOptions) error

Types

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer handles the display of diff output

func NewRenderer

func NewRenderer(opts RendererOptions) *Renderer

NewRenderer creates a new renderer

func (*Renderer) Render

func (r *Renderer) Render(files []parser.FileDiff)

Render displays the diff for all files

type RendererOptions

type RendererOptions struct {
	UseColor         bool
	Unified          bool
	DiffStyle        string
	AddedTextColor   string
	DeletedTextColor string
}

RendererOptions describes configuration for the renderer visuals.

type Theme

type Theme struct {
	// Background colors
	DeletedBg         lipgloss.Color
	AddedBg           lipgloss.Color
	UnchangedBg       lipgloss.Color
	UnchangedBgStripe lipgloss.Color // Alternating row color
	InlineDeletedBg   lipgloss.Color
	InlineAddedBg     lipgloss.Color

	// Foreground colors
	DeletedFg       lipgloss.Color
	AddedFg         lipgloss.Color
	UnchangedFg     lipgloss.Color
	InlineDeletedFg lipgloss.Color
	InlineAddedFg   lipgloss.Color

	// Line number colors
	LineNumDeleted   lipgloss.Color
	LineNumAdded     lipgloss.Color
	LineNumUnchanged lipgloss.Color

	// Header colors
	FileHeaderBg lipgloss.Color
	FileHeaderFg lipgloss.Color

	// Border colors
	BorderColor lipgloss.Color

	// Styles
	DeletedLineStyle      lipgloss.Style
	AddedLineStyle        lipgloss.Style
	UnchangedLineStyle    lipgloss.Style
	UnchangedLineStyleAlt lipgloss.Style // Alternating style
	InlineDeletedStyle    lipgloss.Style
	InlineAddedStyle      lipgloss.Style
	LineNumStyle          lipgloss.Style
	FileHeaderStyle       lipgloss.Style
	SeparatorStyle        lipgloss.Style

	UseLineBackground bool
}

Theme contains all color and style definitions

func NewTheme

func NewTheme(opts ThemeOptions) *Theme

NewTheme creates a new theme with styles based on the provided options.

func NoColorTheme

func NoColorTheme() *Theme

NoColorTheme creates a theme without colors

type ThemeOptions

type ThemeOptions struct {
	DiffStyle        string
	AddedTextColor   string
	DeletedTextColor string
}

Jump to

Keyboard shortcuts

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