Raxol.Terminal.Buffer.Selection (Raxol v0.3.0)

View Source

Handles text selection within the Raxol.Terminal.ScreenBuffer.

Summary

Functions

Checks if a position (x, y) is within the current selection in the buffer.

Gets the boundaries {start_x, start_y, end_x, end_y} of the current selection. Returns nil if there is no selection.

Gets the text within the current selection in the buffer.

Gets the text within a specified rectangular region of the buffer. Coordinates are inclusive.

Starts a selection at the specified coordinates in the buffer.

Updates the endpoint of the current selection in the buffer.

Functions

contains?(buffer, x, y)

Checks if a position (x, y) is within the current selection in the buffer.

get_boundaries(buffer)

Gets the boundaries {start_x, start_y, end_x, end_y} of the current selection. Returns nil if there is no selection.

get_text(buffer)

@spec get_text(Raxol.Terminal.ScreenBuffer.t()) :: String.t()

Gets the text within the current selection in the buffer.

get_text_in_region(buffer, start_x, start_y, end_x, end_y)

Gets the text within a specified rectangular region of the buffer. Coordinates are inclusive.

start(buffer, x, y)

Starts a selection at the specified coordinates in the buffer.

update(buffer, x, y)

Updates the endpoint of the current selection in the buffer.