Documentation
¶
Index ¶
- type DiffLayout
- type DiffLine
- type DiffLineType
- type DiffStyles
- type DiffView
- func (d *DiffView) Init() tea.Cmd
- func (d *DiffView) SetContextLines(lines int)
- func (d *DiffView) SetDiff(diff string)
- func (d *DiffView) SetLayout(layout DiffLayout)
- func (d *DiffView) SetSize(width, height int)
- func (d *DiffView) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (d *DiffView) View() string
- type DiffViewOptions
- type FileDiff
- type Hunk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffLine ¶
type DiffLine struct {
OldNum int
NewNum int
Content string
Type DiffLineType
}
DiffLine represents a single parsed line in a unified diff.
type DiffLineType ¶
type DiffLineType int
DiffLineType identifies the type of a diff line.
const ( DiffLineContext DiffLineType = iota DiffLineAdd DiffLineDelete )
type DiffStyles ¶
type DiffStyles struct {
Header lipgloss.Style
HeaderPath lipgloss.Style
HeaderStats lipgloss.Style
HeaderMode lipgloss.Style
HunkHeader lipgloss.Style
Gap lipgloss.Style
AddedLine lipgloss.Style
RemovedLine lipgloss.Style
ContextLine lipgloss.Style
AddedNumber lipgloss.Style
RemovedNumber lipgloss.Style
ContextNumber lipgloss.Style
AddedMarker lipgloss.Style
RemovedMarker lipgloss.Style
ContextMarker lipgloss.Style
Separator lipgloss.Style
Placeholder lipgloss.Style
}
DiffStyles contains the lipgloss styles used by DiffView.
func NewDiffStyles ¶
func NewDiffStyles(theme tuitheme.Theme) DiffStyles
NewDiffStyles builds styles using the current TUI theme.
type DiffView ¶
type DiffView struct {
// contains filtered or unexported fields
}
DiffView renders parsed unified diffs in unified or split mode.
func NewDiffView ¶
func NewDiffView(opts DiffViewOptions) *DiffView
func (*DiffView) SetContextLines ¶
func (*DiffView) SetLayout ¶
func (d *DiffView) SetLayout(layout DiffLayout)
type DiffViewOptions ¶
type DiffViewOptions struct {
Diff string
Width int
Height int
Layout DiffLayout
ContextLines int
}
DiffViewOptions configures a new DiffView.
Click to show internal directories.
Click to hide internal directories.