summaryrefslogtreecommitdiffstats
path: root/grid-view.c
diff options
context:
space:
mode:
authornicm <nicm>2017-02-08 16:45:18 +0000
committernicm <nicm>2017-02-08 16:45:18 +0000
commit13a0b6bb3fe05454cace81f5ec7624f6fd9021a5 (patch)
tree5b61257ae5a17983cc848ca01c1364d77f7dff7e /grid-view.c
parentd4b006b9faf001de41560db2e8fb890c654598e2 (diff)
Collect sequences of printable ASCII characters and process them
together instead of handling them one by one. This is significantly faster. Sequences are terminated when we reach the end of the line, fill the internal buffer, or a different character is seen by the input parser (an escape sequence, or UTF-8). Rather than writing collected sequences out immediately, hold them until it is necessary (another screen modification, or we consume all available data). This means we can discard changes that would have no effect (for example, lines that would just be scrolled off the screen or cleared). This reduces the total amount of data we write out to the terminal - not important for fast terminals, but a big help with slow (like xterm).
Diffstat (limited to 'grid-view.c')
-rw-r--r--grid-view.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/grid-view.c b/grid-view.c
index da0433bf..b84ac64e 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -45,6 +45,15 @@ grid_view_set_cell(struct grid *gd, u_int px, u_int py,
grid_set_cell(gd, grid_view_x(gd, px), grid_view_y(gd, py), gc);
}
+/* Set cells. */
+void
+grid_view_set_cells(struct grid *gd, u_int px, u_int py,
+ const struct grid_cell *gc, const char *s, size_t slen)
+{
+ grid_set_cells(gd, grid_view_x(gd, px), grid_view_y(gd, py), gc, s,
+ slen);
+}
+
/* Clear into history. */
void
grid_view_clear_history(struct grid *gd, u_int bg)