Raxol.Terminal.Buffer.Manager.Cursor (Raxol v0.5.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 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
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}
@spec move_to( Raxol.Terminal.Buffer.Manager.State.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Buffer.Manager.State.t()
Moves the cursor to the specified coordinates.
@spec move_to_bottom(Raxol.Terminal.Buffer.Manager.State.t()) :: Raxol.Terminal.Buffer.Manager.State.t()
Moves the cursor to the bottom of the screen.
@spec move_to_line_end(Raxol.Terminal.Buffer.Manager.State.t()) :: Raxol.Terminal.Buffer.Manager.State.t()
Moves the cursor to the end of the current line.
@spec move_to_line_start(Raxol.Terminal.Buffer.Manager.State.t()) :: Raxol.Terminal.Buffer.Manager.State.t()
Moves the cursor to the start of the current line.
@spec move_to_top(Raxol.Terminal.Buffer.Manager.State.t()) :: Raxol.Terminal.Buffer.Manager.State.t()
Moves the cursor to the top of the screen.
@spec set_position( Raxol.Terminal.Buffer.Manager.State.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Buffer.Manager.State.t()
Sets the cursor position to the specified coordinates.