Documentation
¶
Overview ¶
Package splitpreview renders the read-only summary of a pending multi-way split, one row per tag with its destination and the amount of work assigned to it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DestinationSpec ¶
type DestinationSpec struct {
ChangeID string
Description string
Type DestinationType
}
DestinationSpec is where one tag's hunks land. ChangeID is empty for DestNewCommit, where Description becomes the message of the commit that gets created.
type DestinationType ¶
type DestinationType int
DestinationType separates a destination that already exists from one that will be created.
const ( DestExistingRevision DestinationType = iota DestNewCommit )
Destinations a tag can be sent to. DestExistingRevision is the zero value, so a DestinationSpec that was never filled in reads as targeting an existing revision.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the preview modal. It only displays what the parent hands it and has no cursor of its own.
func (*Model) IsVisible ¶
IsVisible reports whether the preview is open, which is how the parent decides to route keys here.
func (*Model) SetSummaries ¶
func (m *Model) SetSummaries(summaries []SplitSummary)
SetSummaries replaces the rows. The parent recomputes them, because the counts go stale as soon as a hunk's tag changes.
type SplitSummary ¶
type SplitSummary struct {
Destination DestinationSpec
FileCount int
HunkCount int
Tag SplitTag
}
SplitSummary is one row of the preview. FileCount and HunkCount are what the tag currently holds, so they are recomputed by the parent rather than tracked here.