Raxol.Terminal.Scroll.Manager (Raxol v2.0.1)
View SourceManages terminal scrolling operations with advanced features.
Features:
- Predictive scrolling for smooth performance
- Scroll caching for efficient memory usage
- Scroll optimization for better performance
- Scroll synchronization across splits
Summary
Functions
Clears the scroll history.
Gets the scroll history.
Gets the current scroll metrics.
Creates a new scroll manager.
Optimizes the scroll manager based on current metrics.
Scrolls the terminal content.
Types
@type t() :: %Raxol.Terminal.Scroll.Manager{ metrics: %{ scrolls: non_neg_integer(), predictions: non_neg_integer(), cache_hits: non_neg_integer(), cache_misses: non_neg_integer(), optimizations: non_neg_integer() }, optimizer: Raxol.Terminal.Scroll.Optimizer.t(), predictor: Raxol.Terminal.Scroll.Predictor.t(), sync: Raxol.Terminal.Scroll.Sync.t() }
Functions
Clears the scroll history.
Gets the scroll history.
Parameters
manager- The scroll manageropts- History options:limit- Maximum number of entries to return (default: all):direction- Filter by direction (:up or :down)
Gets the current scroll metrics.
Creates a new scroll manager.
Options
:prediction_enabled- Whether to enable predictive scrolling (default: true):optimization_enabled- Whether to enable scroll optimization (default: true):sync_enabled- Whether to enable scroll synchronization (default: true)
Optimizes the scroll manager based on current metrics.
@spec scroll(t(), :up | :down, non_neg_integer(), keyword()) :: {:ok, t()} | {:error, term()}
Scrolls the terminal content.
Parameters
manager- The scroll managerdirection- Scroll direction (:up or :down)lines- Number of lines to scrollopts- Scroll options:predict- Whether to use prediction (default: true):optimize- Whether to optimize the scroll (default: true):sync- Whether to sync across splits (default: true)