Raxol.Terminal.Buffer.Content (Raxol v0.5.0)

View Source

Handles content operations for the screen buffer. This module provides functions for writing and reading content from the buffer, including character and string operations.

Summary

Functions

Calculates the difference between the current buffer state and a list of changes.

Gets a cell at the specified position.

Gets a character at the specified position.

Gets the entire buffer content as a string.

Gets a line of cells from the buffer.

Updates a line in the buffer with new cells.

Updates the buffer with a list of changes.

Writes a character at the specified position with optional styling.

Writes a string starting at the specified position.

Functions

diff(screen_buffer, changes)

Calculates the difference between the current buffer state and a list of changes.

get_cell(buffer, x, y)

Gets a cell at the specified position.

get_char(buffer, x, y)

Gets a character at the specified position.

get_content(screen_buffer)

@spec get_content(Raxol.Terminal.ScreenBuffer.t()) :: String.t()

Gets the entire buffer content as a string.

get_line(screen_buffer, line_index)

Gets a line of cells from the buffer.

put_line(buffer, line_index, new_cells)

Updates a line in the buffer with new cells.

update(buffer, changes)

Updates the buffer with a list of changes.

write_char(buffer, x, y, char, style \\ nil)

Writes a character at the specified position with optional styling.

write_string(buffer, x, y, string, style \\ nil)

Writes a string starting at the specified position.