| diff_screen | R Documentation |
Computes the minimal set of horizontal runs of cells that must be
rewritten to turn the screen old into new. Nearby runs on the same
row are merged when rewriting the unchanged cells between them is cheaper
than an extra cursor movement.
diff_screen(old, new, merge_gap = 3L)
old, new |
ScreenBuffer objects ( |
merge_gap |
Runs separated by at most this many unchanged cells are merged. |
If old is NULL or has different dimensions, the patch covers every
non-blank cell of new and is marked full = TRUE; the renderer then
clears the screen first.
A termr_patch: a list with full (logical), width, height
and runs, a list of runs. Each run has y, x and vectors chars,
fg, bg, attrs copied from new.
a <- screen_buffer(10, 2)
b <- a$copy()
b$put_text(3, 2, "hi")
diff_screen(a, b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.