diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-23 22:45:13 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-23 22:45:13 +0100 |
commit | fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37 (patch) | |
tree | 011097892e2e03277e33bff533d57c3a5b4a9604 /tui.c | |
parent | 95be2d94d752b20d3d57c1006af8d518a6c1b843 (diff) | |
download | hex-fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37.tar.gz hex-fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37.tar.xz hex-fccfd1dd3b3e256db8759cfd6dba7cf6c3952e37.zip |
Color the ASCII column instead
Diffstat (limited to 'tui.c')
-rw-r--r-- | tui.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 |