Raxol.Terminal.Buffer.Manager.Cursor (Raxol v0.5.0)

View Source

Handles 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 specified coordinates.

Moves the cursor to the bottom of the screen.

Moves the cursor to the end of the current line.

Moves the cursor to the start of the current line.

Moves the cursor to the top of the screen.

Sets the cursor position to the specified coordinates.

Functions

get_position(state)

Gets the current cursor position.

Examples

iex> state = State.new(80, 24)
iex> Cursor.get_position(state)
{0, 0}

move(state, dx, dy)

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}

move_to(state, x, y)

Moves the cursor to the specified coordinates.

move_to_bottom(state)

Moves the cursor to the bottom of the screen.

move_to_line_end(state)

Moves the cursor to the end of the current line.

move_to_line_start(state)

Moves the cursor to the start of the current line.

move_to_top(state)

Moves the cursor to the top of the screen.

set_position(state, x, y)

Sets the cursor position to the specified coordinates.