Raxol.Terminal.ScreenBuffer.Selection (Raxol v2.0.1)
View SourceText selection operations for the screen buffer. Handles selection creation, updates, text extraction, and clipboard operations.
Summary
Functions
Clears the current selection.
Expands selection to word boundaries.
Extends the selection to the specified position.
Gets the selected text as lines.
Gets the selected text as a string.
Gets the current selection boundaries, normalized so start <= end.
Checks if there is an active selection.
Checks if a position is within the current selection.
Selects all content in the buffer.
Selects an entire line.
Selects multiple lines.
Selects a word at the given position.
Checks if the specified position is within the current selection.
Starts a new selection at the specified position.
Types
@type selection() :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()} | nil
Functions
@spec clear_selection(Raxol.Terminal.ScreenBuffer.Core.t()) :: Raxol.Terminal.ScreenBuffer.Core.t()
Clears the current selection.
@spec expand_selection_to_word(Raxol.Terminal.ScreenBuffer.Core.t()) :: Raxol.Terminal.ScreenBuffer.Core.t()
Expands selection to word boundaries.
@spec extend_selection( Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.ScreenBuffer.Core.t()
Extends the selection to the specified position.
@spec get_selected_lines(Raxol.Terminal.ScreenBuffer.Core.t()) :: [String.t()]
Gets the selected text as lines.
@spec get_selected_text(Raxol.Terminal.ScreenBuffer.Core.t()) :: String.t()
Gets the selected text as a string.
@spec get_selection(Raxol.Terminal.ScreenBuffer.Core.t()) :: selection()
Gets the current selection boundaries, normalized so start <= end.
@spec has_selection(Raxol.Terminal.ScreenBuffer.Core.t()) :: boolean()
Checks if there is an active selection.
@spec position_in_selection?( Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer(), non_neg_integer() ) :: boolean()
Checks if a position is within the current selection.
@spec select_all(Raxol.Terminal.ScreenBuffer.Core.t()) :: Raxol.Terminal.ScreenBuffer.Core.t()
Selects all content in the buffer.
@spec select_line(Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer()) :: Raxol.Terminal.ScreenBuffer.Core.t()
Selects an entire line.
@spec select_lines( Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.ScreenBuffer.Core.t()
Selects multiple lines.
@spec select_word( Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.ScreenBuffer.Core.t()
Selects a word at the given position.
@spec selected?( Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer(), non_neg_integer() ) :: boolean()
Checks if the specified position is within the current selection.
@spec start_selection( Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.ScreenBuffer.Core.t()
Starts a new selection at the specified position.