diff options
author | Steffen Jaeckel <jaeckel-floss@eyet-services.de> | 2023-04-03 18:37:23 +0200 |
---|---|---|
committer | Steffen Jaeckel <jaeckel-floss@eyet-services.de> | 2023-04-08 18:38:36 +0200 |
commit | 0cf79848e90289eba34af5b89aafdc9fc8930383 (patch) | |
tree | 9a46dd0cb40bef1a4f993941d058bc580bc1741b /src/command/cmd_ac.c | |
parent | 5f078f95f2b0d77f1f94fbe69aaa0b6ae605b398 (diff) | |
download | profani-tty-0cf79848e90289eba34af5b89aafdc9fc8930383.tar.gz |
add `/statusbar tabmode actlist`
The existing way how active tabs are displayed didn't allow showing more than 10 tabs. This patch adds a mode where the statusbar shows a comma-separated list of tabs which were active since the last time viewed. This view is inspired by how `irssi` shows the active tabs, therefore it is also called `actlist`. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'src/command/cmd_ac.c')
-rw-r--r-- | src/command/cmd_ac.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 0cc4a170..bb204935 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -265,6 +265,7 @@ static Autocomplete statusbar_self_ac; static Autocomplete statusbar_chat_ac; static Autocomplete statusbar_room_ac; static Autocomplete statusbar_show_ac; +static Autocomplete statusbar_tabmode_ac; static Autocomplete clear_ac; static Autocomplete invite_ac; static Autocomplete status_ac; @@ -1030,6 +1031,7 @@ cmd_ac_init(void) autocomplete_add(statusbar_ac, "hide"); autocomplete_add(statusbar_ac, "maxtabs"); autocomplete_add(statusbar_ac, "tablen"); + autocomplete_add(statusbar_ac, "tabmode"); autocomplete_add(statusbar_ac, "self"); autocomplete_add(statusbar_ac, "chat"); autocomplete_add(statusbar_ac, "room"); @@ -1058,6 +1060,10 @@ cmd_ac_init(void) autocomplete_add(statusbar_show_ac, "number"); autocomplete_add(statusbar_show_ac, "read"); + statusbar_tabmode_ac = autocomplete_new(); + autocomplete_add(statusbar_tabmode_ac, "actlist"); + autocomplete_add(statusbar_tabmode_ac, "default"); + status_ac = autocomplete_new(); autocomplete_add(status_ac, "set"); autocomplete_add(status_ac, "get"); @@ -1678,6 +1684,7 @@ cmd_ac_reset(ProfWin* window) autocomplete_reset(statusbar_chat_ac); autocomplete_reset(statusbar_room_ac); autocomplete_reset(statusbar_show_ac); + autocomplete_reset(statusbar_tabmode_ac); autocomplete_reset(clear_ac); autocomplete_reset(invite_ac); autocomplete_reset(status_ac); @@ -1864,6 +1871,7 @@ cmd_ac_uninit(void) autocomplete_free(statusbar_chat_ac); autocomplete_free(statusbar_room_ac); autocomplete_free(statusbar_show_ac); + autocomplete_free(statusbar_tabmode_ac); autocomplete_free(clear_ac); autocomplete_free(invite_ac); autocomplete_free(status_ac); @@ -4110,6 +4118,11 @@ _statusbar_autocomplete(ProfWin* window, const char* const input, gboolean previ return found; } + found = autocomplete_param_with_ac(input, "/statusbar tabmode", statusbar_tabmode_ac, TRUE, previous); + if (found) { + return found; + } + found = autocomplete_param_with_ac(input, "/statusbar room", statusbar_room_ac, TRUE, previous); return found; |