class

TermBuf::Damage

Inherits Reference < Object

Stability: internal

Which cells have changed since the last paint, tracked as one column span per row.

A span rather than a per-cell bitmap because the paint loop walks rows anyway, and rather than a whole-row flag because a status line that changes three characters should not cost a full row of output. The row count lets #any? answer without scanning, so a paint with nothing to do is free.

Constructors

new(height : Int32)
Source

Instance methods

clear

Marks every row clean.

Source
dirty?(y : Int32) : Bool

Whether row y has changed.

Source
dirty?

Whether anything at all has changed.

Source
each

Yields each dirty row and its changed columns, top to bottom.

Source
height

How many rows are tracked.

Source
resize(height : Int32) : Nil

Resizes to height rows, discarding any spans: a resize forces a full repaint, so there is nothing worth carrying over.

Source
rows

Number of rows carrying a span.

Source
span(y : Int32) : Range(Int32, Int32) | Nil

The changed columns of row y, or nil when the row is clean.

Source
touch(x : Int32, y : Int32) : Nil

Records that the cell at (x, y) changed.

Source
touch_all(width : Int32) : Nil

Marks every cell of every row as changed.

Source
touch_span(y : Int32, from : Int32, to : Int32) : Nil

Records that columns from through to of row y changed.

Source