Raxol.Terminal.Buffer.Scroller (Raxol v0.5.0)
View SourceHandles scrolling operations for the terminal buffer.
Summary
Functions
Gets the scroll bottom position.
Gets the scroll top position.
Scrolls the buffer down by the specified number of lines.
Scrolls the entire buffer down by the specified number of lines.
Scrolls the entire buffer up by the specified number of lines.
Scrolls a specific region of the buffer down by the specified number of lines.
Scrolls a specific region of the buffer up by the specified number of lines.
Scrolls the buffer up by the specified number of lines.
Functions
Gets the scroll bottom position.
Gets the scroll top position.
Scrolls the buffer down by the specified number of lines.
@spec scroll_entire_buffer_down(Raxol.Terminal.ScreenBuffer.t(), non_neg_integer()) :: {:ok, Raxol.Terminal.ScreenBuffer.t()}
Scrolls the entire buffer down by the specified number of lines.
Parameters
buffer
- The screen buffer to scrollcount
- The number of lines to scroll down
Returns
A tuple containing :ok and the updated buffer.
Examples
iex> buffer = ScreenBuffer.new(80, 24)
iex> {:ok, new_buffer} = Scroller.scroll_entire_buffer_down(buffer, 1)
iex> length(new_buffer.content)
24
@spec scroll_entire_buffer_up(Raxol.Terminal.ScreenBuffer.t(), non_neg_integer()) :: {:ok, Raxol.Terminal.ScreenBuffer.t()}
Scrolls the entire buffer up by the specified number of lines.
Parameters
buffer
- The screen buffer to scrollcount
- The number of lines to scroll up
Returns
A tuple containing :ok and the updated buffer.
Examples
iex> buffer = ScreenBuffer.new(80, 24)
iex> {:ok, new_buffer} = Scroller.scroll_entire_buffer_up(buffer, 1)
iex> length(new_buffer.content)
24
@spec scroll_region_down( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: {:ok, Raxol.Terminal.ScreenBuffer.t()}
Scrolls a specific region of the buffer down by the specified number of lines.
Parameters
buffer
- The screen buffer to scrollcount
- The number of lines to scroll downtop
- The top boundary of the scroll regionbottom
- The bottom boundary of the scroll region
Returns
A tuple containing :ok and the updated buffer.
Examples
iex> buffer = ScreenBuffer.new(80, 24)
iex> {:ok, new_buffer} = Scroller.scroll_region_down(buffer, 1, 5, 15)
iex> length(new_buffer.content)
24
@spec scroll_region_up( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: {:ok, Raxol.Terminal.ScreenBuffer.t()}
Scrolls a specific region of the buffer up by the specified number of lines.
Parameters
buffer
- The screen buffer to scrollcount
- The number of lines to scroll uptop
- The top boundary of the scroll regionbottom
- The bottom boundary of the scroll region
Returns
A tuple containing :ok and the updated buffer.
Examples
iex> buffer = ScreenBuffer.new(80, 24)
iex> {:ok, new_buffer} = Scroller.scroll_region_up(buffer, 1, 5, 15)
iex> length(new_buffer.content)
24
Scrolls the buffer up by the specified number of lines.