aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-03-26 20:59:37 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-03-26 20:59:37 +0100
commitdc71af9c31b33165bcb10fe78b5594f0b1c94af9 (patch)
treed32b7a061ccfa3e0e4489243cd246924703b5748 /degesch.c
parentf964495d1ac6587f04a3e2d216af512e240c8bed (diff)
downloadxK-dc71af9c31b33165bcb10fe78b5594f0b1c94af9.tar.gz
xK-dc71af9c31b33165bcb10fe78b5594f0b1c94af9.tar.xz
xK-dc71af9c31b33165bcb10fe78b5594f0b1c94af9.zip
degesch: fix two minor issues
- completely new unread markers could be created in active buffers - control characters confused word wrapping
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index ed55e24..08b66a5 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3292,6 +3292,10 @@ line_char_new (const char *mb, size_t mb_len, wchar_t wc)
memcpy (self->bytes, mb, (self->len = MIN (mb_len, sizeof self->bytes)));
self->width = wcwidth ((self->wide = wc));
+ // Typically various control characters
+ if (self->width < 0)
+ self->width = 0;
+
self->attrs.bg = self->attrs.fg = -1;
self->attrs.named = ATTR_RESET;
return self;
@@ -3777,7 +3781,9 @@ log_formatter (struct app_context *ctx,
else
displayed = false;
- if (!displayed || buffer == ctx->current_buffer)
+ // Advance the unread marker in active buffers but don't create a new one
+ if (!displayed
+ || (buffer == ctx->current_buffer && buffer->new_messages_count))
{
buffer->new_messages_count++;
if (flags & BUFFER_LINE_UNIMPORTANT)