summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index c433733..29909d5 100644
--- a/degesch.c
+++ b/degesch.c
@@ -11759,6 +11759,45 @@ on_switch_buffer (int count, int key, void *user_data)
}
static bool
+on_goto_highlight (int count, int key, void *user_data)
+{
+ (void) count;
+ (void) key;
+
+ struct app_context *ctx = user_data;
+ struct buffer *new_buffer = ctx->current_buffer;
+ while (!new_buffer->highlighted)
+ {
+ if (!(new_buffer = new_buffer->next))
+ new_buffer = ctx->buffers;
+ if (new_buffer == ctx->current_buffer)
+ return false;
+ }
+ buffer_activate (ctx, new_buffer);
+ return true;
+}
+
+static bool
+on_goto_activity (int count, int key, void *user_data)
+{
+ (void) count;
+ (void) key;
+
+ struct app_context *ctx = user_data;
+ struct buffer *new_buffer = ctx->current_buffer;
+ while (new_buffer->unseen_messages_count
+ == new_buffer->unseen_unimportant_count)
+ {
+ if (!(new_buffer = new_buffer->next))
+ new_buffer = ctx->buffers;
+ if (new_buffer == ctx->current_buffer)
+ return false;
+ }
+ buffer_activate (ctx, new_buffer);
+ return true;
+}
+
+static bool
on_redraw_screen (int count, int key, void *user_data)
{
(void) count;
@@ -11799,6 +11838,8 @@ bind_common_keys (struct app_context *ctx)
XX ("next-buffer", "Next buffer", on_next_buffer)
XX ("goto-buffer", "Go to buffer", on_goto_buffer)
XX ("switch-buffer", "Switch buffer", on_switch_buffer)
+ XX ("goto-highlight", "Go to highlight", on_goto_highlight)
+ XX ("goto-activity", "Go to activity", on_goto_activity)
XX ("display-backlog", "Show backlog", on_display_backlog)
XX ("display-full-log", "Show full log", on_display_full_log)
XX ("edit-input", "Edit input", on_edit_input)
@@ -11815,6 +11856,8 @@ bind_common_keys (struct app_context *ctx)
CALL_ (self, bind_meta, '0' + i, "goto-buffer");
CALL_ (self, bind_meta, '\t', "switch-buffer");
+ CALL_ (self, bind_meta, '!', "goto-highlight");
+ CALL_ (self, bind_meta, '@', "goto-activity");
CALL_ (self, bind_meta, 'm', "insert-attribute");
CALL_ (self, bind_meta, 'h', "display-full-log");
CALL_ (self, bind_meta, 'e', "edit-input");