Raxol.Terminal.Buffer.Manager.State (Raxol v0.3.0)
View SourceHandles state management for the terminal buffer manager. Provides functionality for initializing and managing buffer state.
Summary
Functions
Gets the current dimensions of the buffer.
Gets the scrollback height.
Creates a new buffer manager state with the given dimensions.
Switches the active and back buffers.
Updates the active buffer in the state.
Updates the back buffer in the state.
Types
@type t() :: %Raxol.Terminal.Buffer.Manager.State{ active_buffer: Raxol.Terminal.ScreenBuffer.t(), back_buffer: Raxol.Terminal.ScreenBuffer.t(), cursor_position: {non_neg_integer(), non_neg_integer()}, damage_tracker: Raxol.Terminal.Buffer.DamageTracker.t(), memory_limit: non_neg_integer(), memory_usage: non_neg_integer(), scrollback: Raxol.Terminal.Buffer.Scrollback.t() }
Functions
Gets the current dimensions of the buffer.
Gets the scrollback height.
Creates a new buffer manager state with the given dimensions.
Examples
iex> {:ok, state} = State.new(80, 24)
iex> state.active_buffer.width
80
iex> state.active_buffer.height
24
Switches the active and back buffers.
Examples
iex> state = State.new(80, 24)
iex> state = State.switch_buffers(state)
iex> state.active_buffer == state.back_buffer
false
Updates the active buffer in the state.
Updates the back buffer in the state.