Raxol.Terminal.Scroll.UnifiedScroll (Raxol v0.5.0)

View Source

Unified scroll management system for the terminal.

This module consolidates all scroll-related functionality including:

  • Scroll buffer management
  • Scroll operations (up/down)
  • Scroll region handling
  • Memory management
  • Performance optimization

Summary

Functions

Adds a line to the scroll buffer.

Cleans up the scroll buffer.

Clears the scroll buffer.

Clears the scroll region.

Gets the total height of the scroll buffer.

Gets the current scroll position.

Gets a view of the scroll buffer at the current position.

Gets the visible region of the scroll buffer.

Creates a new scroll buffer with the given dimensions and configuration.

Resizes the scroll buffer to the new height.

Scrolls the buffer by the given amount.

Scrolls the buffer in the specified direction by the given amount.

Updates the maximum height of the scroll buffer.

Sets the scroll region.

Updates the scroll buffer with new commands.

Types

t()

@type t() :: %Raxol.Terminal.Scroll.UnifiedScroll{
  buffer: [[Raxol.Terminal.Cell.t()]],
  cache: map(),
  compression_ratio: float(),
  height: non_neg_integer(),
  max_height: non_neg_integer(),
  memory_limit: non_neg_integer(),
  memory_usage: non_neg_integer(),
  position: non_neg_integer(),
  scroll_region: {non_neg_integer(), non_neg_integer()} | nil
}

Functions

add_line(scroll, line)

Adds a line to the scroll buffer.

cleanup(scroll_buffer)

Cleans up the scroll buffer.

clear(scroll)

Clears the scroll buffer.

clear_scroll_region(scroll)

Clears the scroll region.

get_height(scroll)

Gets the total height of the scroll buffer.

get_position(scroll)

Gets the current scroll position.

get_view(scroll, view_height)

Gets a view of the scroll buffer at the current position.

get_visible_region(scroll)

Gets the visible region of the scroll buffer.

new(max_height, memory_limit \\ 5_000_000)

Creates a new scroll buffer with the given dimensions and configuration.

resize(scroll, new_height)

Resizes the scroll buffer to the new height.

scroll(scroll, amount)

Scrolls the buffer by the given amount.

scroll(scroll, direction, amount)

Scrolls the buffer in the specified direction by the given amount.

set_max_height(scroll, new_max_height)

Updates the maximum height of the scroll buffer.

set_scroll_region(scroll, top, bottom)

Sets the scroll region.

update(scroll_buffer, commands)

Updates the scroll buffer with new commands.