Raxol.Terminal.Buffer.Updater (Raxol v0.3.0)

View Source

Handles calculating differences and applying updates to the Raxol.Terminal.ScreenBuffer.

Summary

Functions

Calculates the difference between the current buffer state and a list of desired cell changes. Returns a list of {x, y, cell_map} tuples representing only the cells that need to be updated. Input changes must be a list of {x, y, map} tuples.

Updates the buffer state by applying a list of cell changes. Changes must be in the format {x, y, Cell.t() | map()}. Returns the updated buffer.

Functions

diff(buffer, changes)

Calculates the difference between the current buffer state and a list of desired cell changes. Returns a list of {x, y, cell_map} tuples representing only the cells that need to be updated. Input changes must be a list of {x, y, map} tuples.

update(buffer, changes)

Updates the buffer state by applying a list of cell changes. Changes must be in the format {x, y, Cell.t() | map()}. Returns the updated buffer.