Raxol.Terminal.ScreenBuffer.Scroll (Raxol v2.0.1)

View Source

Scrolling and scrollback operations for the buffer. Consolidates: Scroll, Scroller, ScrollRegion, Scrollback, and operations/scrolling.

Summary

Functions

Adds a line to the scrollback buffer (alias for save_to_scrollback).

Clears the scroll region (sets it to nil).

Clears the scrollback buffer.

Gets the current scroll position.

Gets the effective scroll region.

Gets scrollback lines.

Gets a specific line from the scrollback buffer.

Gets visible lines including scrollback based on scroll position.

Performs an index (scroll up if at bottom of scroll region).

Performs a reverse index (scroll down if at top of scroll region).

Saves lines to scrollback buffer.

Scrolls the buffer or scroll region down by n lines.

Scrolls the specified region down by n lines.

Scrolls down within a specific region.

Scrolls up within a specific region.

Scrolls to the bottom (most recent content).

Scrolls to the top (oldest scrollback).

Scrolls the buffer or scroll region up by n lines.

Scrolls the specified region up by n lines.

Sets the scroll position for viewing scrollback.

Sets the scroll region.

Functions

add_to_scrollback(buffer, line)

Adds a line to the scrollback buffer (alias for save_to_scrollback).

clear_scroll_region(buffer)

Clears the scroll region (sets it to nil).

clear_scrollback(buffer)

Clears the scrollback buffer.

get_scroll_position(buffer)

@spec get_scroll_position(Raxol.Terminal.ScreenBuffer.Core.t()) :: non_neg_integer()

Gets the current scroll position.

get_scroll_region(buffer)

Gets the effective scroll region.

get_scrollback(buffer, limit \\ nil)

@spec get_scrollback(Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer() | nil) ::
  [
    [Raxol.Terminal.Cell.t()]
  ]

Gets scrollback lines.

get_scrollback_line(buffer, index)

@spec get_scrollback_line(Raxol.Terminal.ScreenBuffer.Core.t(), non_neg_integer()) ::
  [Raxol.Terminal.Cell.t()] | nil

Gets a specific line from the scrollback buffer.

get_visible_lines(buffer)

@spec get_visible_lines(Raxol.Terminal.ScreenBuffer.Core.t()) :: [
  [Raxol.Terminal.Cell.t()]
]

Gets visible lines including scrollback based on scroll position.

index(buffer)

Performs an index (scroll up if at bottom of scroll region).

reverse_index(buffer)

Performs a reverse index (scroll down if at top of scroll region).

save_to_scrollback(buffer, lines)

Saves lines to scrollback buffer.

scroll_down(buffer, n \\ 1)

Scrolls the buffer or scroll region down by n lines.

scroll_down(buffer, top, bottom, lines)

Scrolls the specified region down by n lines.

scroll_region_down(buffer, top, bottom, n)

Scrolls down within a specific region.

scroll_region_up(buffer, top, bottom, n)

Scrolls up within a specific region.

scroll_to_bottom(buffer)

Scrolls to the bottom (most recent content).

scroll_to_top(buffer)

Scrolls to the top (oldest scrollback).

scroll_up(buffer, n \\ 1)

Scrolls the buffer or scroll region up by n lines.

scroll_up(buffer, top, bottom, lines)

Scrolls the specified region up by n lines.

set_scroll_position(buffer, position)

Sets the scroll position for viewing scrollback.

set_scroll_region(buffer, top, bottom)

Sets the scroll region.