Raxol.UI.Components.Input.TextInput.Selection (Raxol v0.5.0)

View Source

Handles cursor and text selection operations for the TextInput component. This includes cursor movement, text selection, and selection clearing.

Summary

Functions

Clears any existing text selection.

Gets the currently selected text, if any.

Moves the cursor by the specified offset, ensuring it stays within bounds.

Moves the cursor to the end of the text.

Moves the cursor to the start of the text.

Extends or creates a text selection by moving the cursor.

Selects text from the current cursor position to the end of the text.

Selects text from the current cursor position to the start of the text.

Functions

clear_selection(state)

Clears any existing text selection.

get_selected_text(state)

Gets the currently selected text, if any.

move_cursor(state, offset)

Moves the cursor by the specified offset, ensuring it stays within bounds.

move_to_end(state)

Moves the cursor to the end of the text.

move_to_home(state)

Moves the cursor to the start of the text.

select_text(state, offset)

Extends or creates a text selection by moving the cursor.

select_to_end(state)

Selects text from the current cursor position to the end of the text.

select_to_home(state)

Selects text from the current cursor position to the start of the text.