Skip to main content

Module scroll

Module scroll 

Source
Expand description

message-cursor math. a cursor names a line by its absolute sequence number (how many lines the channel had appended before it), which stays put while the ring evicts old lines, grows at the live end, or gets history backfilled in front — so the view stays anchored without any bookkeeping on arrival. seq = lines ever appended, len = lines held now; the held lines are seq - len .. seq.

Functions§

abs_of
absolute number of the held line at idx.
index_of
index of absolute line abs, clamped into what is still held (an evicted line snaps to the oldest, a future one to the newest). None when empty.
newer
lines newer than the cursor — what arrived while the view is parked.
step
move a cursor by delta lines, staying inside the held lines.