TUI::EnumField
Inherits TUI::FormField < Reference < Object
Single-select from a fixed Array(FormEnumOption), tracked by
@focus_index — focus and selection are the same thing here, unlike
FlagsField where they're independent. Wire format is the focused
option's wire_value (see #value/#start); #value falls back to
"" if @options is empty or @focus_index is somehow out of range,
rather than raising. Up/Down move focus; Space or Enter commit; Esc
cancels without writing back, per FormField's stated rationale that a
picker with nothing chosen yet has no sensible commit value.
Constructors
Instance methods
Returns :commit or :cancel once the edit finishes; nil while it's still in progress (the key was consumed either way).
Draws this field's current edit state. height bounds how many
buffer rows this field may draw into. focused gates any
keyboard-cursor decoration that should be suppressed when
rendering a persisted value outside an active edit session (only
FlagsField uses this — see its #render).
Loads a persisted wire-value string into this field's edit state.
Fragment of a host's status-bar hint describing this field's own key bindings while it's being edited — owned here (rather than left for a host to re-derive per kind) so the bindings shown to the user can never drift from what #handle_key actually does.