Raxol.Terminal.Buffer.Selection (Raxol v0.5.0)
View SourceManages text selection operations for the terminal. This module handles all selection-related operations including:
- Starting and updating selections
- Getting selected text
- Checking if positions are within selections
- Managing selection boundaries
- Extracting text from regions
Summary
Functions
Checks if there is an active selection.
Clears the current selection.
Checks if a position is within the current selection.
Gets the current selection boundaries.
Gets the selection end position.
Gets the selection start position.
Gets the currently selected text.
Gets text from a specified region in the buffer.
Starts a text selection at the specified position.
Updates the current text selection to the specified position.
Functions
@spec active?(Raxol.Terminal.ScreenBuffer.t()) :: boolean()
Checks if there is an active selection.
@spec clear(Raxol.Terminal.ScreenBuffer.t()) :: Raxol.Terminal.ScreenBuffer.t()
Clears the current selection.
@spec contains?(Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer()) :: boolean()
Checks if a position is within the current selection.
@spec get_boundaries(Raxol.Terminal.ScreenBuffer.t()) :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()} | nil
Gets the current selection boundaries.
@spec get_end_position(Raxol.Terminal.ScreenBuffer.t()) :: {non_neg_integer(), non_neg_integer()} | nil
Gets the selection end position.
@spec get_start_position(Raxol.Terminal.ScreenBuffer.t()) :: {non_neg_integer(), non_neg_integer()} | nil
Gets the selection start position.
@spec get_text(Raxol.Terminal.ScreenBuffer.t()) :: String.t()
Gets the currently selected text.
@spec get_text_in_region( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: String.t()
Gets text from a specified region in the buffer.
@spec start(Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer()) :: Raxol.Terminal.ScreenBuffer.t()
Starts a text selection at the specified position.
@spec update(Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer()) :: Raxol.Terminal.ScreenBuffer.t()
Updates the current text selection to the specified position.