Raxol.Terminal.Selection.Manager (Raxol v0.5.0)

View Source

Manages text selection operations in the terminal.

Summary

Functions

Ends the current selection.

Gets the selected text from the terminal buffer.

Gets the current selection range.

Includes scrollback buffer in selection.

Creates a new selection manager instance.

Checks if a position is within the current selection.

Checks if scrollback is included in selection.

Starts a new selection at the given position.

Updates the selection end position.

Types

position()

@type position() :: {non_neg_integer(), non_neg_integer()}

selection_mode()

@type selection_mode() :: :normal | :word | :line

t()

@type t() :: %Raxol.Terminal.Selection.Manager{
  active: boolean(),
  end_pos: position() | nil,
  mode: selection_mode(),
  scrollback_included: boolean(),
  start_pos: position() | nil
}

Functions

end_selection(state)

Ends the current selection.

get_selected_text(state, buffer)

Gets the selected text from the terminal buffer.

get_selection_range(state)

Gets the current selection range.

include_scrollback(state, include \\ true)

Includes scrollback buffer in selection.

new()

Creates a new selection manager instance.

position_in_selection?(state, pos)

Checks if a position is within the current selection.

scrollback_included?(state)

Checks if scrollback is included in selection.

start_selection(state, pos, mode \\ :normal)

Starts a new selection at the given position.

update_selection(state, pos)

Updates the selection end position.