Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveScope ¶ added in v0.10.3
func DeriveScope(action keybindings.Action) string
DeriveScope determines the intent scope from generated built-in metadata. Non-built-in actions have no scope.
Types ¶
type Continuation ¶
Continuation describes possible next keys while in sequence mode.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher resolves key presses against active scopes and bindings.
func NewDispatcher ¶
func NewDispatcher(availableBindings []bindings.Binding) (*Dispatcher, error)
func (*Dispatcher) ResetSequence ¶
func (d *Dispatcher) ResetSequence()
func (*Dispatcher) Resolve ¶
func (d *Dispatcher) Resolve(msg tea.KeyMsg, scopes []Scope) ResolveResult
Resolve applies dispatch rules for a key in the provided layer chain. Scopes must be ordered from innermost to outermost.
type LeakPolicy ¶ added in v0.10.3
type LeakPolicy int
const ( LeakAll LeakPolicy = iota LeakGlobal LeakNone )
type ResolveResult ¶
type ResolveResult struct {
Action bindings.Action
Scope bindings.ScopeName
Args map[string]any
Pending bool
Consumed bool
Continuations []Continuation
}
ResolveResult is the outcome of resolving a key press.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver wraps a Dispatcher and extends the pipeline to resolve keys all the way to intents and scopes.
func NewResolver ¶
func NewResolver(d *Dispatcher) *Resolver
NewResolver creates a Resolver that wraps the given dispatcher.
func (*Resolver) ResetSequence ¶
func (r *Resolver) ResetSequence()
ResetSequence resets any in-progress key sequence.
func (*Resolver) ResolveAction ¶
ResolveAction resolves a dispatched action through configured-action aliasing and intent resolution.
func (*Resolver) ResolveBuiltInAction ¶
ResolveBuiltInAction resolves an action while skipping configured Lua overrides.
type Result ¶
type Result struct {
Intent intents.Intent
Scope string
Args map[string]any
LuaScript string
Pending bool
Consumed bool
Continuations []Continuation
}
Result is the outcome of full dispatch resolution.
type Scope ¶ added in v0.10.3
type Scope struct {
Name keybindings.ScopeName
Leak LeakPolicy
Global bool
Handler ScopeHandler
}
Scope represents one routing layer in the intent dispatch chain. Scopes are ordered from innermost (highest priority) to outermost.
func VisibleScopes ¶ added in v0.10.3
type ScopeHandler ¶ added in v0.10.3
type ScopeProvider ¶ added in v0.10.3
type ScopeProvider interface {
Scopes() []Scope
}