Raxol.Terminal.Emulator.ScrollOperations (Raxol v2.0.1)

View Source

Scroll operation functions extracted from the main emulator module. Handles scroll region management and scroll positioning.

Summary

Functions

Gets the bottom scroll position.

Gets the scroll region from the emulator.

Gets the top scroll position.

Gets the scrollback buffer from the emulator.

Checks if the cursor needs to scroll and performs scrolling if necessary.

Scrolls the terminal down by the specified number of lines.

Scrolls the terminal up by the specified number of lines.

Updates the scroll region with new top and bottom bounds.

Types

emulator()

@type emulator() :: Raxol.Terminal.Emulator.t()

Functions

get_scroll_bottom(emulator)

@spec get_scroll_bottom(emulator()) :: non_neg_integer()

Gets the bottom scroll position.

get_scroll_region(emulator)

@spec get_scroll_region(emulator()) :: {non_neg_integer(), non_neg_integer()} | nil

Gets the scroll region from the emulator.

get_scroll_top(emulator)

@spec get_scroll_top(emulator()) :: non_neg_integer()

Gets the top scroll position.

get_scrollback(emulator)

@spec get_scrollback(emulator()) :: list()

Gets the scrollback buffer from the emulator.

maybe_scroll(emulator)

@spec maybe_scroll(emulator()) :: emulator()

Checks if the cursor needs to scroll and performs scrolling if necessary.

scroll_down(emulator, lines)

@spec scroll_down(emulator(), non_neg_integer()) :: emulator()

Scrolls the terminal down by the specified number of lines.

scroll_up(emulator, lines)

@spec scroll_up(emulator(), non_neg_integer()) :: emulator()

Scrolls the terminal up by the specified number of lines.

update_scroll_region(emulator, arg)

@spec update_scroll_region(
  emulator(),
  {non_neg_integer(), non_neg_integer()}
) :: emulator()

Updates the scroll region with new top and bottom bounds.