about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-05-31 10:03:22 +0200
committerGitHub <noreply@github.com>2021-05-31 10:03:22 +0200
commit956fd547c1beaeb1254b2899f1f3576f5511128a (patch)
tree1e4baf645cd61d75682ccbf722223592ac5fbaca /src/command
parent9f174c53cf7d52a7b684ed1e0d6ed00463eb498b (diff)
parent6df062b542d2376d464b2a9d8d6577fdf906cab4 (diff)
downloadprofani-tty-956fd547c1beaeb1254b2899f1f3576f5511128a.tar.gz
Merge pull request #1543 from DebXWoody/feature/attention-flag
Feature - attention flag
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c1
-rw-r--r--src/command/cmd_defs.c3
-rw-r--r--src/command/cmd_funcs.c7
-rw-r--r--src/command/cmd_funcs.h1
4 files changed, 12 insertions, 0 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index b84d4d2e..03c6e404 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -471,6 +471,7 @@ cmd_ac_init(void)
 
     wins_ac = autocomplete_new();
     autocomplete_add(wins_ac, "unread");
+    autocomplete_add(wins_ac, "attention");
     autocomplete_add(wins_ac, "prune");
     autocomplete_add(wins_ac, "swap");
 
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 4ebc3432..0ebcf04f 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -973,6 +973,7 @@ static struct cmd_t command_defs[] = {
       parse_args, 0, 3, NULL,
       CMD_SUBFUNCS(
               { "unread", cmd_wins_unread },
+              { "attention", cmd_wins_attention },
               { "prune", cmd_wins_prune },
               { "swap", cmd_wins_swap })
       CMD_MAINFUNC(cmd_wins)
@@ -981,6 +982,7 @@ static struct cmd_t command_defs[] = {
       CMD_SYN(
               "/wins",
               "/wins unread",
+              "/wins attention",
               "/wins prune",
               "/wins swap <source> <target>")
       CMD_DESC(
@@ -988,6 +990,7 @@ static struct cmd_t command_defs[] = {
               "Passing no argument will list all currently active windows and information about their usage.")
       CMD_ARGS(
               { "unread", "List windows with unread messages." },
+              { "attention", "List windows that have been marked with the attention flag (alt+f). You can toggle between marked windows with alt+m." },
               { "prune", "Close all windows with no unread messages." },
               { "swap <source> <target>", "Swap windows, target may be an empty position." })
       CMD_NOEXAMPLES
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index a56f0cfc..901c81a3 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -1299,6 +1299,13 @@ cmd_wins_unread(ProfWin* window, const char* const command, gchar** args)
 }
 
 gboolean
+cmd_wins_attention(ProfWin* window, const char* const command, gchar** args)
+{
+    cons_show_wins_attention();
+    return TRUE;
+}
+
+gboolean
 cmd_wins_prune(ProfWin* window, const char* const command, gchar** args)
 {
     ui_prune_wins();
diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h
index 0785963b..aadcb55f 100644
--- a/src/command/cmd_funcs.h
+++ b/src/command/cmd_funcs.h
@@ -209,6 +209,7 @@ gboolean cmd_otr_sendfile(ProfWin* window, const char* const command, gchar** ar
 
 gboolean cmd_wins(ProfWin* window, const char* const command, gchar** args);
 gboolean cmd_wins_unread(ProfWin* window, const char* const command, gchar** args);
+gboolean cmd_wins_attention(ProfWin* window, const char* const command, gchar** args);
 gboolean cmd_wins_prune(ProfWin* window, const char* const command, gchar** args);
 gboolean cmd_wins_swap(ProfWin* window, const char* const command, gchar** args);