Raxol.Terminal.Buffer.Manager.Scrollback (Raxol v0.5.0)
View SourceHandles scrollback buffer management for the terminal. Provides functionality for managing scrollback history and operations.
Summary
Functions
Adds a line to the scrollback buffer.
Clears the scrollback buffer.
Checks if the scrollback buffer is full.
Gets the scrollback height limit.
Gets a line from the scrollback buffer.
Gets the number of lines in the scrollback buffer.
Gets a range of lines from the scrollback buffer.
Gets the newest line in the scrollback buffer.
Gets the oldest line in the scrollback buffer.
Sets a new scrollback height limit.
Functions
Adds a line to the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Hello, World!")
iex> Scrollback.get_line(state, 0)
"Hello, World!"
Clears the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Hello, World!")
iex> state = Scrollback.clear(state)
iex> Scrollback.get_line_count(state)
0
Checks if the scrollback buffer is full.
Examples
iex> state = State.new(80, 24)
iex> Scrollback.full?(state)
false
Gets the scrollback height limit.
Examples
iex> state = State.new(80, 24)
iex> Scrollback.get_height(state)
1000
Gets a line from the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Hello, World!")
iex> Scrollback.get_line(state, 0)
"Hello, World!"
Gets the number of lines in the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Hello, World!")
iex> Scrollback.get_line_count(state)
1
Gets a range of lines from the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Line 1")
iex> state = Scrollback.add_line(state, "Line 2")
iex> Scrollback.get_lines(state, 0, 2)
["Line 1", "Line 2"]
Gets the newest line in the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Newest line")
iex> Scrollback.get_newest_line(state)
"Newest line"
Gets the oldest line in the scrollback buffer.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.add_line(state, "Oldest line")
iex> Scrollback.get_oldest_line(state)
"Oldest line"
Sets a new scrollback height limit.
Examples
iex> state = State.new(80, 24)
iex> state = Scrollback.set_height(state, 2000)
iex> Scrollback.get_height(state)
2000