Raxol.Terminal.Scrollback.Manager (Raxol v0.5.0)

View Source

Manages terminal scrollback buffer operations.

Summary

Functions

Adds a line to the scrollback buffer.

Clears the scrollback buffer.

Gets the current line from the scrollback buffer.

Gets the current scrollback position.

Gets the current scrollback buffer.

Gets the scrollback limit.

Gets a range of lines from the scrollback buffer.

Gets the current size of the scrollback buffer.

Creates a new scrollback manager instance.

Scrolls down in the scrollback buffer.

Scrolls up in the scrollback buffer.

Checks if the scrollback buffer is empty.

Sets the current scrollback position.

Sets the scrollback limit.

Types

scrollback_buffer()

@type scrollback_buffer() :: [scrollback_line()]

scrollback_line()

@type scrollback_line() :: String.t()

t()

@type t() :: %Raxol.Terminal.Scrollback.Manager{
  current_position: non_neg_integer(),
  scrollback_buffer: scrollback_buffer(),
  scrollback_limit: pos_integer()
}

Functions

add_to_scrollback(state, line)

Adds a line to the scrollback buffer.

clear_scrollback(state)

Clears the scrollback buffer.

get_current_line(state)

Gets the current line from the scrollback buffer.

get_current_position(state)

Gets the current scrollback position.

get_scrollback_buffer(state)

Gets the current scrollback buffer.

get_scrollback_limit(state)

Gets the scrollback limit.

get_scrollback_range(state, start_line, end_line)

Gets a range of lines from the scrollback buffer.

get_scrollback_size(state)

Gets the current size of the scrollback buffer.

new(opts \\ [])

Creates a new scrollback manager instance.

scroll_down(state, lines \\ 1)

Scrolls down in the scrollback buffer.

scroll_up(state, lines \\ 1)

Scrolls up in the scrollback buffer.

scrollback_empty?(state)

Checks if the scrollback buffer is empty.

set_current_position(state, position)

Sets the current scrollback position.

set_scrollback_limit(state, limit)

Sets the scrollback limit.