Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloseDiffViewMsg ¶
type CloseDiffViewMsg struct{}
CloseDiffViewMsg is sent when the diff view should be closed.
type DiffDataLoadedMsg ¶
type DiffDataLoadedMsg struct {
Files []git.FileDiff
Stats *git.CommitOverview
Err error
}
DiffDataLoadedMsg is sent when diff data has been loaded.
type DiffSource ¶
type DiffSource struct {
Kind git.DiffKind
Path string // for single-file diffs
Commit string // for commit diffs (full hash)
Range string // for range diffs e.g. "main..feature"
Stash string // for stash diffs e.g. "stash@{0}"
}
DiffSource describes what is being diffed.
type HunkStagedMsg ¶
type HunkStagedMsg struct {
Err error
}
HunkStagedMsg is sent after a hunk has been staged or unstaged.
type KeyMap ¶
type KeyMap struct {
// Navigation
MoveDown key.Binding
MoveUp key.Binding
PageDown key.Binding
PageUp key.Binding
HalfPageDown key.Binding
HalfPageUp key.Binding
GoToTop key.Binding
GoToBottom key.Binding
// Hunk navigation
NextHunk key.Binding
PrevHunk key.Binding
NextHunkHeader key.Binding
PrevHunkHeader key.Binding
// File navigation
NextFile key.Binding
PrevFile key.Binding
// Actions
StageHunk key.Binding
UnstageHunk key.Binding
// Horizontal scroll
ScrollLeft key.Binding
ScrollRight key.Binding
ScrollStart key.Binding
ScrollEnd key.Binding
// Toggle fold
Toggle key.Binding
// Close
Close key.Binding
CloseEscape key.Binding
}
KeyMap defines key bindings for the diff view.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns the default key bindings for the diff view.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the diff view model for displaying diffs.
func New ¶
func New(repo *git.Repository, source DiffSource, cfg *config.Config, tokens theme.Tokens) Model
New creates a new diff view model.
type OpenDiffViewMsg ¶
type OpenDiffViewMsg struct {
Source DiffSource
}
OpenDiffViewMsg triggers opening the diff view at the app level.
Click to show internal directories.
Click to hide internal directories.