From fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Mon, 23 Jan 2017 22:45:13 +0100 Subject: Color the ASCII column instead --- tui.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tui.c') 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 -- cgit v1.2.3