common

package
v0.26.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const StatusMessageTimeout = time.Second * 3 // How long to show status messages.

Variables

This section is empty.

Functions

func WaitForStatusMessageTimeout

func WaitForStatusMessageTimeout(t *time.Timer) tea.Cmd

Types

type Commander

type Commander interface {
	RunContext(ctx context.Context) command.Output
	RunOnEvent()
	String() string
	Subscribe(ch chan<- command.Event)
	GetProfiles() map[string]*profile.Profile
	GetCurrentProfile() (string, *profile.Profile)
	FindProfiles(path string) ([]command.ProfileMatch, error)
	ConfigureContext(ctx context.Context, opts ...command.RunnerOpt) error
	RunPluginContext(ctx context.Context, name string) command.Output
	FS() (*command.FilteredFS, error)
}

type CommonModel

type CommonModel struct {
	Cmd                Commander
	Theme              *theme.Theme
	StatusMessageTimer *time.Timer
	KeyBinds           *KeyBinds
	StatusMessage      StatusMessage
	Width              int
	Height             int
	Loaded             bool
	ShowStatusMessage  bool // Whether to show the status message in the status bar.
}

func (*CommonModel) GetStatusBar

func (m *CommonModel) GetStatusBar() *statusbar.StatusBarRenderer

func (*CommonModel) SendStatusMessage

func (m *CommonModel) SendStatusMessage(msg string, style statusbar.Style) tea.Cmd

Show a status (success) message to the user.

type ErrMsg

type ErrMsg struct{ Err error } //nolint:errname // Tea message.

func (ErrMsg) Error

func (e ErrMsg) Error() string

type KeyBinds

type KeyBinds struct {
	Quit    *keys.KeyBind `json:"quit,omitempty"`
	Suspend *keys.KeyBind `json:"suspend,omitempty"`
	Reload  *keys.KeyBind `json:"reload,omitempty"`
	Help    *keys.KeyBind `json:"help,omitempty"`
	Error   *keys.KeyBind `json:"error,omitempty"`
	Escape  *keys.KeyBind `json:"escape,omitempty"`
	Menu    *keys.KeyBind `json:"menu,omitempty"`

	// Navigation.
	Up    *keys.KeyBind `json:"up,omitempty"`
	Down  *keys.KeyBind `json:"down,omitempty"`
	Left  *keys.KeyBind `json:"left,omitempty"`
	Right *keys.KeyBind `json:"right,omitempty"`
	Prev  *keys.KeyBind `json:"prev,omitempty"`
	Next  *keys.KeyBind `json:"next,omitempty"`
}

func (*KeyBinds) EnsureDefaults

func (kb *KeyBinds) EnsureDefaults()

func (*KeyBinds) GetKeyBinds

func (kb *KeyBinds) GetKeyBinds() []keys.KeyBind

type StatusMessage

type StatusMessage struct {
	Message string
	Style   statusbar.Style
}

type StatusMessageTimeoutMsg

type StatusMessageTimeoutMsg struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL