Documentation
¶
Index ¶
- func LoadCustomCommands(output string) (map[string]CustomCommand, error)
- type CommandRunner
- type CustomCommand
- type CustomCommandBase
- type CustomRevsetCommand
- type CustomRunCommand
- type Leader
- type LeaderMap
- type MainCommandRunner
- func (a *MainCommandRunner) RunCommand(args []string, continuations ...tea.Cmd) tea.Cmd
- func (a *MainCommandRunner) RunCommandImmediate(args []string) ([]byte, error)
- func (a *MainCommandRunner) RunCommandStreaming(ctx context.Context, args []string) (*StreamingCommand, error)
- func (a *MainCommandRunner) RunInteractiveCommand(args []string, continuation tea.Cmd) tea.Cmd
- type MainContext
- func (ctx *MainContext) AddCheckedItem(item SelectedItem)
- func (ctx *MainContext) ClearCheckedItems(ofType reflect.Type)
- func (ctx *MainContext) CreateReplacements() map[string]string
- func (ctx *MainContext) GetSelectedRevisions() map[string]bool
- func (ctx *MainContext) RemoveCheckedItem(item SelectedItem)
- func (ctx *MainContext) SetSelectedItem(item SelectedItem) tea.Cmd
- func (ctx *MainContext) ToggleCheckedItem(item SelectedRevision)
- type SelectedFile
- type SelectedItem
- type SelectedOperation
- type SelectedRevision
- type StreamingCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCustomCommands ¶ added in v0.9.0
func LoadCustomCommands(output string) (map[string]CustomCommand, error)
Types ¶
type CommandRunner ¶ added in v0.8.12
type CustomCommand ¶ added in v0.9.0
type CustomCommand interface {
Binding() key.Binding
Description(ctx *MainContext) string
Prepare(ctx *MainContext) tea.Cmd
IsApplicableTo(item SelectedItem) bool
}
type CustomCommandBase ¶ added in v0.9.0
func (CustomCommandBase) Binding ¶ added in v0.9.0
func (c CustomCommandBase) Binding() key.Binding
type CustomRevsetCommand ¶ added in v0.9.0
type CustomRevsetCommand struct {
CustomCommandBase
Revset string `toml:"revset"`
}
func (CustomRevsetCommand) Description ¶ added in v0.9.0
func (c CustomRevsetCommand) Description(ctx *MainContext) string
func (CustomRevsetCommand) IsApplicableTo ¶ added in v0.9.0
func (c CustomRevsetCommand) IsApplicableTo(item SelectedItem) bool
func (CustomRevsetCommand) Prepare ¶ added in v0.9.0
func (c CustomRevsetCommand) Prepare(ctx *MainContext) tea.Cmd
type CustomRunCommand ¶ added in v0.9.0
type CustomRunCommand struct {
CustomCommandBase
Args []string `toml:"args"`
Show config.ShowOption `toml:"show"`
}
func (CustomRunCommand) Description ¶ added in v0.9.0
func (c CustomRunCommand) Description(ctx *MainContext) string
func (CustomRunCommand) IsApplicableTo ¶ added in v0.9.0
func (c CustomRunCommand) IsApplicableTo(item SelectedItem) bool
func (CustomRunCommand) Prepare ¶ added in v0.9.0
func (c CustomRunCommand) Prepare(ctx *MainContext) tea.Cmd
type LeaderMap ¶ added in v0.9.0
func LoadLeader ¶ added in v0.9.0
type MainCommandRunner ¶ added in v0.8.12
type MainCommandRunner struct {
Location string
}
func (*MainCommandRunner) RunCommand ¶ added in v0.8.12
func (a *MainCommandRunner) RunCommand(args []string, continuations ...tea.Cmd) tea.Cmd
func (*MainCommandRunner) RunCommandImmediate ¶ added in v0.8.12
func (a *MainCommandRunner) RunCommandImmediate(args []string) ([]byte, error)
func (*MainCommandRunner) RunCommandStreaming ¶ added in v0.8.12
func (a *MainCommandRunner) RunCommandStreaming(ctx context.Context, args []string) (*StreamingCommand, error)
func (*MainCommandRunner) RunInteractiveCommand ¶ added in v0.8.12
func (a *MainCommandRunner) RunInteractiveCommand(args []string, continuation tea.Cmd) tea.Cmd
type MainContext ¶
type MainContext struct {
CommandRunner
SelectedItem SelectedItem // Single item where cursor is hover.
CheckedItems []SelectedItem // Items checked ✓ by the user.
Location string
CustomCommands map[string]CustomCommand
Leader LeaderMap
JJConfig *config.JJConfig
DefaultRevset string
CurrentRevset string
Histories *config.Histories
}
func NewAppContext ¶
func NewAppContext(location string) *MainContext
func (*MainContext) AddCheckedItem ¶ added in v0.9.1
func (ctx *MainContext) AddCheckedItem(item SelectedItem)
func (*MainContext) ClearCheckedItems ¶ added in v0.9.1
func (ctx *MainContext) ClearCheckedItems(ofType reflect.Type)
func (*MainContext) CreateReplacements ¶ added in v0.9.0
func (ctx *MainContext) CreateReplacements() map[string]string
CreateReplacements context aware replacements for custom commands and exec input.
func (*MainContext) GetSelectedRevisions ¶ added in v0.9.2
func (ctx *MainContext) GetSelectedRevisions() map[string]bool
func (*MainContext) RemoveCheckedItem ¶ added in v0.9.1
func (ctx *MainContext) RemoveCheckedItem(item SelectedItem)
func (*MainContext) SetSelectedItem ¶
func (ctx *MainContext) SetSelectedItem(item SelectedItem) tea.Cmd
func (*MainContext) ToggleCheckedItem ¶ added in v0.9.2
func (ctx *MainContext) ToggleCheckedItem(item SelectedRevision)
type SelectedFile ¶
func (SelectedFile) Equal ¶ added in v0.8.1
func (s SelectedFile) Equal(other SelectedItem) bool
type SelectedItem ¶
type SelectedItem interface {
Equal(other SelectedItem) bool
}
type SelectedOperation ¶ added in v0.8.1
type SelectedOperation struct {
OperationId string
}
func (SelectedOperation) Equal ¶ added in v0.8.1
func (s SelectedOperation) Equal(other SelectedItem) bool
type SelectedRevision ¶
func (SelectedRevision) Equal ¶ added in v0.8.1
func (s SelectedRevision) Equal(other SelectedItem) bool
type StreamingCommand ¶ added in v0.8.12
type StreamingCommand struct {
io.ReadCloser
ErrPipe io.ReadCloser
// contains filtered or unexported fields
}
func (*StreamingCommand) Close ¶ added in v0.8.12
func (c *StreamingCommand) Close() error
Click to show internal directories.
Click to hide internal directories.