MingaEditor.State.Picker (Minga v0.1.0)

Copy Markdown View Source

Groups picker-related fields from EditorState.

Tracks the current picker instance, the source module providing candidates, the buffer index to restore on cancel, and the action-menu overlay state.

Summary

Types

Action menu state: {actions, selected_index} or nil when closed.

t()

Functions

Returns true if a picker is currently open.

Updates the inner MingaEditor.UI.Picker instance.

Types

action_menu()

@type action_menu() ::
  {[MingaEditor.UI.Picker.Source.action_entry()], non_neg_integer()} | nil

Action menu state: {actions, selected_index} or nil when closed.

t()

@type t() :: %MingaEditor.State.Picker{
  action_menu: action_menu(),
  context: map() | nil,
  layout: MingaEditor.UI.Picker.Source.layout(),
  mode_prefix: String.t(),
  original_source: module() | nil,
  picker: MingaEditor.UI.Picker.t() | nil,
  restore: non_neg_integer() | nil,
  restore_theme: MingaEditor.UI.Theme.t() | nil,
  source: module() | nil
}

Functions

open?(picker)

@spec open?(t()) :: boolean()

Returns true if a picker is currently open.

update_picker(ps, picker)

@spec update_picker(t(), MingaEditor.UI.Picker.t()) :: t()

Updates the inner MingaEditor.UI.Picker instance.