aboutsummaryrefslogtreecommitdiff
path: root/xC.c
diff options
context:
space:
mode:
Diffstat (limited to 'xC.c')
-rw-r--r--xC.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/xC.c b/xC.c
index 7f06083..ff7b3c4 100644
--- a/xC.c
+++ b/xC.c
@@ -5235,6 +5235,18 @@ buffer_clear (struct app_context *ctx, struct buffer *buffer)
buffer->lines_count = 0;
}
+static void
+buffer_toggle_unimportant (struct app_context *ctx, struct buffer *buffer)
+{
+ buffer->hide_unimportant ^= true;
+
+ relay_prepare_buffer_update (ctx, buffer);
+ relay_broadcast (ctx);
+
+ if (buffer == ctx->current_buffer)
+ buffer_print_backlog (ctx, buffer);
+}
+
static struct buffer *
buffer_at_index (struct app_context *ctx, int n)
{
@@ -14372,12 +14384,7 @@ on_toggle_unimportant (int count, int key, void *user_data)
(void) count;
(void) key;
struct app_context *ctx = user_data;
- ctx->current_buffer->hide_unimportant ^= true;
-
- relay_prepare_buffer_update (ctx, ctx->current_buffer);
- relay_broadcast (ctx);
-
- buffer_print_backlog (ctx, ctx->current_buffer);
+ buffer_toggle_unimportant (ctx, ctx->current_buffer);
return true;
}
@@ -15444,10 +15451,12 @@ client_message_buffer_name (const struct relay_command_message *m)
{
case RELAY_COMMAND_BUFFER_COMPLETE:
return m->data.buffer_input.buffer_name.str;
- case RELAY_COMMAND_BUFFER_INPUT:
- return m->data.buffer_input.buffer_name.str;
case RELAY_COMMAND_BUFFER_ACTIVATE:
return m->data.buffer_activate.buffer_name.str;
+ case RELAY_COMMAND_BUFFER_INPUT:
+ return m->data.buffer_input.buffer_name.str;
+ case RELAY_COMMAND_BUFFER_TOGGLE_UNIMPORTANT:
+ return m->data.buffer_toggle_unimportant.buffer_name.str;
case RELAY_COMMAND_BUFFER_LOG:
return m->data.buffer_log.buffer_name.str;
default:
@@ -15573,11 +15582,14 @@ client_process_message (struct client *c,
client_process_buffer_complete (c, m->command_seq, buffer,
&m->data.buffer_complete);
break;
+ case RELAY_COMMAND_BUFFER_ACTIVATE:
+ buffer_activate (c->ctx, buffer);
+ break;
case RELAY_COMMAND_BUFFER_INPUT:
process_input (c->ctx, buffer, m->data.buffer_input.text.str);
break;
- case RELAY_COMMAND_BUFFER_ACTIVATE:
- buffer_activate (c->ctx, buffer);
+ case RELAY_COMMAND_BUFFER_TOGGLE_UNIMPORTANT:
+ buffer_toggle_unimportant (c->ctx, buffer);
break;
case RELAY_COMMAND_BUFFER_LOG:
client_process_buffer_log (c, m->command_seq, buffer);