Raxol.UI.Components.Input.MultiLineInput.NavigationHelper (Raxol v0.5.0)

View Source

Helper functions for cursor navigation and text selection in MultiLineInput.

Summary

Functions

clear_selection(state)

is_line_in_selection?(line_index, start_pos, end_pos)

move_cursor(state, arg2)

Moves the cursor.

It can take a {row, col} tuple to move to a specific position, or an atom to move directionally.

Directions

  • {row, col}: Moves to the specified position, clamped to document bounds.
  • :left: Moves one position to the left, or to the end of the previous line.
  • :right: Moves one position to the right, or to the start of the next line.
  • :up: Moves up by one line.
  • :down: Moves down by one line.
  • :word_left: Moves one word to the left.
  • :word_right: Moves one word to the right.

move_cursor_doc_end(state)

move_cursor_doc_start(state)

move_cursor_line_end(state)

move_cursor_line_start(state)

move_cursor_page(state, direction)

move_cursor_word_left(state)

Moves the cursor one word to the left, using regex to find the previous word boundary.

move_cursor_word_right(state)

Moves the cursor one word to the right, using regex to find the next word boundary.

normalize_selection(state)

select(state, range_or_direction)

select_all(state)