Plushie.Command.Text (Plushie v0.7.1)

Copy Markdown View Source

Text input commands: selection and cursor movement.

All functions support window-qualified paths ("window#widget").

Example

def update(model, %WidgetEvent{type: :click, id: "select-all"}) do
  {model, Command.Text.select_all("main#email")}
end

Summary

Functions

Sends the move_cursor_to command to the widget.

Sends the move_cursor_to_end command to the widget.

Sends the move_cursor_to_front command to the widget.

Sends the select_all command to the widget.

Sends the select_range command to the widget.

Functions

move_cursor_to(widget_id, value)

@spec move_cursor_to(String.t(), integer()) :: Plushie.Command.t()

Sends the move_cursor_to command to the widget.

move_cursor_to_end(widget_id)

@spec move_cursor_to_end(String.t()) :: Plushie.Command.t()

Sends the move_cursor_to_end command to the widget.

move_cursor_to_front(widget_id)

@spec move_cursor_to_front(String.t()) :: Plushie.Command.t()

Sends the move_cursor_to_front command to the widget.

select_all(widget_id)

@spec select_all(String.t()) :: Plushie.Command.t()

Sends the select_all command to the widget.

select_range(widget_id, start_pos, end_pos)

@spec select_range(String.t(), integer(), integer()) :: Plushie.Command.t()

Sends the select_range command to the widget.