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

View Source

Handles scrollback buffer operations for the screen buffer. This module manages the history of lines that have scrolled off the screen, including adding, retrieving, and clearing scrollback content.

Summary

Functions

Adds a line to the scrollback buffer.

Adds multiple lines to the scrollback buffer.

Clears the scrollback buffer.

Checks if the scrollback buffer is full.

Gets the current scrollback limit.

Gets a specific line from the scrollback buffer.

Gets lines from the scrollback buffer.

Gets the newest line in the scrollback buffer.

Gets the oldest line in the scrollback buffer.

Returns a new scrollback buffer with default settings.

Sets the scrollback limit.

Gets the total number of lines in the scrollback buffer.

Types

t()

@type t() :: %Raxol.Terminal.Buffer.Scrollback{limit: integer(), lines: list()}

Functions

add_line(buffer, line)

Adds a line to the scrollback buffer.

add_lines(buffer, lines)

Adds multiple lines to the scrollback buffer.

clear(buffer)

Clears the scrollback buffer.

full?(buffer)

Checks if the scrollback buffer is full.

get_limit(buffer)

Gets the current scrollback limit.

get_line(buffer, index)

Gets a specific line from the scrollback buffer.

get_lines(buffer, start, count)

Gets lines from the scrollback buffer.

get_newest_line(buffer)

@spec get_newest_line(Raxol.Terminal.ScreenBuffer.t()) ::
  [Raxol.Terminal.Cell.t()] | nil

Gets the newest line in the scrollback buffer.

get_oldest_line(buffer)

@spec get_oldest_line(Raxol.Terminal.ScreenBuffer.t()) ::
  [Raxol.Terminal.Cell.t()] | nil

Gets the oldest line in the scrollback buffer.

new()

@spec new() :: t()

Returns a new scrollback buffer with default settings.

set_limit(buffer, limit)

Sets the scrollback limit.

size(buffer)

Gets the total number of lines in the scrollback buffer.