aboutsummaryrefslogtreecommitdiff
path: root/tui.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-01-23 22:45:13 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-01-23 22:45:13 +0100
commitfccfd1dd3b3e256db8759cfd6dba7cf6c3952e37 (patch)
tree011097892e2e03277e33bff533d57c3a5b4a9604 /tui.c
parent95be2d94d752b20d3d57c1006af8d518a6c1b843 (diff)
downloadhex-fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37.tar.gz
hex-fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37.tar.xz
hex-fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37.zip
Color the ASCII column instead
Diffstat (limited to 'tui.c')
-rw-r--r--tui.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tui.c b/tui.c
index 726ec57..d313bcb 100644
--- a/tui.c
+++ b/tui.c
@@ -154,6 +154,20 @@ row_buffer_append_args (struct row_buffer *self, const char *s, ...)
va_end (ap);
}
+static void
+row_buffer_append_buffer (struct row_buffer *self, const struct row_buffer *rb)
+{
+ while (self->chars_alloc - self->chars_len < rb->chars_len)
+ self->chars = xreallocarray (self->chars,
+ sizeof *self->chars, (self->chars_alloc <<= 1));
+
+ memcpy (self->chars + self->chars_len, rb->chars,
+ rb->chars_len * sizeof *rb->chars);
+
+ self->chars_len += rb->chars_len;
+ self->total_width += rb->total_width;
+}
+
/// Pop as many codepoints as needed to free up "space" character cells.
/// Given the suffix nature of combining marks, this should work pretty fine.
static int