Raxol.Terminal.Scroll.Predictor (Raxol Terminal v2.6.0)

Copy Markdown View Source

Handles predictive scrolling operations for the terminal. Tracks recent scrolls and provides pattern analysis for smarter prediction.

Summary

Functions

Analyzes recent scroll patterns: returns average scroll size and alternation ratio.

Creates a new predictor instance.

Adds a scroll event to the history and keeps only the window size worth of history.

Types

scroll_event()

@type scroll_event() :: %{
  direction: :up | :down,
  lines: non_neg_integer(),
  timestamp: integer()
}

t()

@type t() :: %Raxol.Terminal.Scroll.Predictor{
  history: [scroll_event()],
  window_size: non_neg_integer()
}

Functions

analyze_patterns(predictor)

Analyzes recent scroll patterns: returns average scroll size and alternation ratio.

new()

Creates a new predictor instance.

predict(predictor, direction, lines)

Adds a scroll event to the history and keeps only the window size worth of history.