From 85cebbcfa236005daf91698ed38498fc2b206e7e Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sun, 21 Jun 2015 04:00:20 +0200 Subject: degesch: make highlights more obvious Just the tiniest bit. --- degesch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/degesch.c b/degesch.c index ccd5d00..4259d73 100644 --- a/degesch.c +++ b/degesch.c @@ -979,6 +979,7 @@ struct buffer unsigned lines_count; ///< How many lines we have unsigned unseen_messages_count; ///< # messages since last visited + bool highlighted; ///< We've been highlighted // Origin information: @@ -2519,6 +2520,9 @@ buffer_send_internal (struct app_context *ctx, struct buffer *buffer, LIST_APPEND_WITH_TAIL (buffer->lines, buffer->lines_tail, line); buffer->lines_count++; + // TODO: beep if so configured and either the line is a highlight, + // or the buffer is an inactive PM buffer + if (buffer == ctx->current_buffer) { buffer_line_display (ctx, line, false); @@ -2538,6 +2542,9 @@ buffer_send_internal (struct app_context *ctx, struct buffer *buffer, else { buffer->unseen_messages_count++; + if (flags & BUFFER_LINE_HIGHLIGHT) + buffer->highlighted = true; + refresh_prompt (ctx); } } @@ -2620,6 +2627,7 @@ buffer_print_backlog (struct app_context *ctx, struct buffer *buffer) for (; line; line = line->next) buffer_line_display (ctx, line, false); buffer->unseen_messages_count = 0; + buffer->highlighted = false; refresh_prompt (ctx); } @@ -3690,6 +3698,8 @@ make_unseen_prefix (struct app_context *ctx) if (active_buffers.len) str_append_c (&active_buffers, ','); + if (iter->highlighted) + str_append_c (&active_buffers, '!'); str_append_printf (&active_buffers, "%zu", i); } @@ -4436,7 +4446,6 @@ irc_handle_notice_text (struct server *s, if (buffer) { - // TODO: some more obvious indication of highlights int flags = irc_is_highlight (s, text->str) ? BUFFER_LINE_HIGHLIGHT : 0; -- cgit v1.2.3-70-g09d2