Raxol.Terminal.Buffer.Manager.Cursor (Raxol v0.3.0)
View SourceHandles cursor management for the terminal buffer. Provides functionality for cursor position tracking and movement.
Summary
Functions
Gets the current cursor position.
Moves the cursor relative to its current position.
Moves the cursor to the bottom of the screen.
Moves the cursor to the end of the line.
Moves the cursor to the beginning of the line.
Moves the cursor to the top of the screen.
Sets the cursor position in the buffer state.
Functions
Gets the current cursor position.
Examples
iex> state = State.new(80, 24)
iex> Cursor.get_position(state)
{0, 0}
Moves the cursor relative to its current position.
Examples
iex> state = State.new(80, 24)
iex> state = Cursor.move(state, 5, 3)
iex> Cursor.get_position(state)
{5, 3}
Moves the cursor to the bottom of the screen.
Examples
iex> state = State.new(80, 24)
iex> state = Cursor.set_position(state, 10, 5)
iex> state = Cursor.move_to_bottom(state)
iex> Cursor.get_position(state)
{10, 23}
Moves the cursor to the end of the line.
Examples
iex> state = State.new(80, 24)
iex> state = Cursor.set_position(state, 10, 5)
iex> state = Cursor.move_to_line_end(state)
iex> Cursor.get_position(state)
{79, 5}
Moves the cursor to the beginning of the line.
Examples
iex> state = State.new(80, 24)
iex> state = Cursor.set_position(state, 10, 5)
iex> state = Cursor.move_to_line_start(state)
iex> Cursor.get_position(state)
{0, 5}
Moves the cursor to the top of the screen.
Examples
iex> state = State.new(80, 24)
iex> state = Cursor.set_position(state, 10, 5)
iex> state = Cursor.move_to_top(state)
iex> Cursor.get_position(state)
{10, 0}
Sets the cursor position in the buffer state.
Examples
iex> state = State.new(80, 24)
iex> state = Cursor.set_position(state, 10, 5)
iex> Cursor.get_position(state)
{10, 5}