Raxol.Terminal.ScreenBuffer.ScrollOps (Raxol Terminal v2.6.1)

Copy Markdown View Source

Scroll operations for ScreenBuffer: region management and scroll up/down.

Summary

Functions

clear_scroll_region(buffer)

get_scroll_bottom(buffer)

get_scroll_position(buffer)

get_scroll_region(buffer)

get_scroll_region_boundaries(buffer)

get_scroll_top(buffer)

reset_scroll_region(buffer)

scroll_down(buffer, lines)

Scrolls the buffer content down by the specified number of lines within the scroll region.

scroll_down(buffer, top, bottom, lines)

Scrolls down within an explicit top/bottom region.

scroll_down_with_count(buffer, lines, count)

scroll_to(buffer, top, bottom, line)

scroll_up(buffer, lines)

Scrolls the buffer content up by the specified number of lines within the scroll region. Returns {buffer, scrolled_lines}.

scroll_up(buffer, top, bottom, lines)

Scrolls up within an explicit top/bottom region.

Returns {buffer, scrolled_out_rows} -- the rows evicted from the top of the region, oldest-first -- mirroring scroll_up/2's two-arg contract. Whether scrolled_out_rows is scrollback-eligible depends on the region: callers feeding an effective top of 0 (screen row 1, including the no-region/full-screen case) should treat them as real scrollback history; callers with an interior region (top > 0) discard them, matching real-terminal behavior where only a top-anchored scroll region feeds native scrollback.

set_scroll_region(buffer, arg)

set_scroll_region(buffer, top, bottom)

shift_region_to_line(buffer, region, target_line)