Documentation
¶
Index ¶
- func CtrlKey(key rune) tea.KeyMsg
- func KeyPress(key rune) tea.KeyMsg
- func SpecialKey(keyType tea.KeyType) tea.KeyMsg
- func TestChanges() []diff.FileChange
- type DestinationSpec
- type DestinationType
- type FileSelection
- type FocusedPanel
- type HunkSelection
- type Model
- func NewModel(client *jj.Client, source, destination string, mode OperatingMode, ...) (Model, error)
- func NewModelWithSource(source diff.DiffSource, client *jj.Client, destination string, ...) (Model, error)
- func NewTestModel(t *testing.T, mode OperatingMode) Model
- func Update(t *testing.T, m Model, msg tea.Msg) Model
- func UpdateWithCmd(t *testing.T, m Model, msg tea.Msg) Model
- type ModelAssertion
- func (a *ModelAssertion) DestPickerIsNotVisible() *ModelAssertion
- func (a *ModelAssertion) DestPickerIsVisible() *ModelAssertion
- func (a *ModelAssertion) FileFinderIsNotVisible() *ModelAssertion
- func (a *ModelAssertion) FileFinderIsVisible() *ModelAssertion
- func (a *ModelAssertion) FileListFilterModeDisabled() *ModelAssertion
- func (a *ModelAssertion) FileListFilterModeEnabled() *ModelAssertion
- func (a *ModelAssertion) FocusedPanelIs(panel FocusedPanel) *ModelAssertion
- func (a *ModelAssertion) HasChanges(count int) *ModelAssertion
- func (a *ModelAssertion) HasDestination(dest string) *ModelAssertion
- func (a *ModelAssertion) HasError() *ModelAssertion
- func (a *ModelAssertion) HasHunkNotSelected(filePath string, hunkIdx int) *ModelAssertion
- func (a *ModelAssertion) HasHunkSelected(filePath string, hunkIdx int) *ModelAssertion
- func (a *ModelAssertion) HasLineCursor(position int) *ModelAssertion
- func (a *ModelAssertion) HasNoError() *ModelAssertion
- func (a *ModelAssertion) HasSelectedFile(idx int) *ModelAssertion
- func (a *ModelAssertion) HasSelectedHunk(idx int) *ModelAssertion
- func (a *ModelAssertion) HelpIsNotVisible() *ModelAssertion
- func (a *ModelAssertion) HelpIsVisible() *ModelAssertion
- func (a *ModelAssertion) IsInVisualMode() *ModelAssertion
- func (a *ModelAssertion) IsNotInVisualMode() *ModelAssertion
- func (a *ModelAssertion) ModeIs(mode OperatingMode) *ModelAssertion
- func (a *ModelAssertion) NoModalsVisible() *ModelAssertion
- func (a *ModelAssertion) SearchIsNotVisible() *ModelAssertion
- func (a *ModelAssertion) SearchIsVisible() *ModelAssertion
- type MultiSplitState
- type OperatingMode
- type SelectionState
- func (s *SelectionState) HasPartialSelection(filePath string, hunkIdx int) bool
- func (s *SelectionState) IsHunkSelected(filePath string, hunkIdx int) bool
- func (s *SelectionState) IsLineSelected(filePath string, hunkIdx, lineIdx int) bool
- func (s *SelectionState) SelectLineRange(filePath string, hunkIdx, startLine, endLine int)
- func (s *SelectionState) ToggleHunk(filePath string, hunkIdx int)
- func (s *SelectionState) ToggleLine(filePath string, hunkIdx, lineIdx int)
- type SplitTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SpecialKey ¶
SpecialKey creates a tea.KeyMsg for special keys
func TestChanges ¶
func TestChanges() []diff.FileChange
TestChanges creates sample file changes for testing
Types ¶
type DestinationSpec ¶
type DestinationSpec struct {
Type DestinationType
ChangeID string
Description string
}
type DestinationType ¶
type DestinationType int
const ( DestExistingRevision DestinationType = iota DestNewCommit )
type FileSelection ¶
type FileSelection struct {
Hunks map[int]*HunkSelection
}
type HunkSelection ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModelWithSource ¶
func NewModelWithSource(source diff.DiffSource, client *jj.Client, destination string, mode OperatingMode, cfg config.Config) (Model, error)
func NewTestModel ¶
func NewTestModel(t *testing.T, mode OperatingMode) Model
TestModel creates a model with mock client for testing
func UpdateWithCmd ¶
UpdateWithCmd processes a message and executes any returned command synchronously
func (Model) WithChanges ¶
func (m Model) WithChanges(changes []diff.FileChange) Model
WithChanges sets up the model with test file changes
func (Model) WithDestination ¶
WithDestination sets a destination for the model
type ModelAssertion ¶
type ModelAssertion struct {
// contains filtered or unexported fields
}
ModelAssertion provides fluent assertions on model state
func Assert ¶
func Assert(t *testing.T, m Model) *ModelAssertion
Assert creates a new ModelAssertion for fluent testing
func (*ModelAssertion) DestPickerIsNotVisible ¶
func (a *ModelAssertion) DestPickerIsNotVisible() *ModelAssertion
func (*ModelAssertion) DestPickerIsVisible ¶
func (a *ModelAssertion) DestPickerIsVisible() *ModelAssertion
func (*ModelAssertion) FileFinderIsNotVisible ¶
func (a *ModelAssertion) FileFinderIsNotVisible() *ModelAssertion
func (*ModelAssertion) FileFinderIsVisible ¶
func (a *ModelAssertion) FileFinderIsVisible() *ModelAssertion
func (*ModelAssertion) FileListFilterModeDisabled ¶
func (a *ModelAssertion) FileListFilterModeDisabled() *ModelAssertion
func (*ModelAssertion) FileListFilterModeEnabled ¶
func (a *ModelAssertion) FileListFilterModeEnabled() *ModelAssertion
func (*ModelAssertion) FocusedPanelIs ¶
func (a *ModelAssertion) FocusedPanelIs(panel FocusedPanel) *ModelAssertion
func (*ModelAssertion) HasChanges ¶
func (a *ModelAssertion) HasChanges(count int) *ModelAssertion
func (*ModelAssertion) HasDestination ¶
func (a *ModelAssertion) HasDestination(dest string) *ModelAssertion
func (*ModelAssertion) HasError ¶
func (a *ModelAssertion) HasError() *ModelAssertion
func (*ModelAssertion) HasHunkNotSelected ¶
func (a *ModelAssertion) HasHunkNotSelected(filePath string, hunkIdx int) *ModelAssertion
func (*ModelAssertion) HasHunkSelected ¶
func (a *ModelAssertion) HasHunkSelected(filePath string, hunkIdx int) *ModelAssertion
func (*ModelAssertion) HasLineCursor ¶
func (a *ModelAssertion) HasLineCursor(position int) *ModelAssertion
func (*ModelAssertion) HasNoError ¶
func (a *ModelAssertion) HasNoError() *ModelAssertion
func (*ModelAssertion) HasSelectedFile ¶
func (a *ModelAssertion) HasSelectedFile(idx int) *ModelAssertion
func (*ModelAssertion) HasSelectedHunk ¶
func (a *ModelAssertion) HasSelectedHunk(idx int) *ModelAssertion
func (*ModelAssertion) HelpIsNotVisible ¶
func (a *ModelAssertion) HelpIsNotVisible() *ModelAssertion
func (*ModelAssertion) HelpIsVisible ¶
func (a *ModelAssertion) HelpIsVisible() *ModelAssertion
func (*ModelAssertion) IsInVisualMode ¶
func (a *ModelAssertion) IsInVisualMode() *ModelAssertion
func (*ModelAssertion) IsNotInVisualMode ¶
func (a *ModelAssertion) IsNotInVisualMode() *ModelAssertion
func (*ModelAssertion) ModeIs ¶
func (a *ModelAssertion) ModeIs(mode OperatingMode) *ModelAssertion
func (*ModelAssertion) NoModalsVisible ¶
func (a *ModelAssertion) NoModalsVisible() *ModelAssertion
func (*ModelAssertion) SearchIsNotVisible ¶
func (a *ModelAssertion) SearchIsNotVisible() *ModelAssertion
func (*ModelAssertion) SearchIsVisible ¶
func (a *ModelAssertion) SearchIsVisible() *ModelAssertion
type MultiSplitState ¶
type MultiSplitState struct {
Active bool
Selections map[SplitTag]*SelectionState
Destinations map[SplitTag]*DestinationSpec
CurrentTag SplitTag
}
func NewMultiSplitState ¶
func NewMultiSplitState() *MultiSplitState
type OperatingMode ¶
type OperatingMode int
const ( ModeBrowse OperatingMode = iota ModeInteractive ModeDiffEditor )
type SelectionState ¶
type SelectionState struct {
Files map[string]*FileSelection
}
func NewSelectionState ¶
func NewSelectionState() *SelectionState
func (*SelectionState) HasPartialSelection ¶
func (s *SelectionState) HasPartialSelection(filePath string, hunkIdx int) bool
func (*SelectionState) IsHunkSelected ¶
func (s *SelectionState) IsHunkSelected(filePath string, hunkIdx int) bool
func (*SelectionState) IsLineSelected ¶
func (s *SelectionState) IsLineSelected(filePath string, hunkIdx, lineIdx int) bool
func (*SelectionState) SelectLineRange ¶
func (s *SelectionState) SelectLineRange(filePath string, hunkIdx, startLine, endLine int)
func (*SelectionState) ToggleHunk ¶
func (s *SelectionState) ToggleHunk(filePath string, hunkIdx int)
func (*SelectionState) ToggleLine ¶
func (s *SelectionState) ToggleLine(filePath string, hunkIdx, lineIdx int)
Click to show internal directories.
Click to hide internal directories.