Documentation
¶
Overview ¶
Package destpicker lists candidate revisions so the user can choose where changes move. The parent model loads the revisions, routes keys here while the picker is visible, and reads the highlighted entry back out on confirmation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the destination picker. Mutators take a pointer receiver, so a parent holding it by value must keep the same field rather than a copy.
func New ¶
func New() Model
New returns a hidden picker with no revisions, so SetRevisions must run before Show.
func (Model) GetSelected ¶
func (m Model) GetSelected() *jj.RevisionEntry
GetSelected returns a pointer into the revision slice, or nil when the list is empty. The pointer is invalidated by the next SetRevisions, so read what is needed before calling it.
func (*Model) Hide ¶
func (m *Model) Hide()
Hide takes the picker off screen and leaves the revisions and cursor in place, so a later Show resumes on the same row.
func (*Model) IsVisible ¶
IsVisible reports whether keys belong to the picker rather than the main view.
func (*Model) MoveDown ¶
func (m *Model) MoveDown()
MoveDown moves the cursor one revision later in the list and stops at the last, without wrapping.
func (*Model) MoveUp ¶
func (m *Model) MoveUp()
MoveUp moves the cursor one revision earlier in the list and stops at the first, without wrapping.
func (*Model) SetRevisions ¶
func (m *Model) SetRevisions(revisions []jj.RevisionEntry)
SetRevisions replaces the candidate list, keeping the cursor where it is when the new list is long enough and falling back to the first row otherwise. The slice is retained, not copied.