Added /wins unread

This commit is contained in:
James Booth
2015-11-30 00:17:44 +00:00
parent d9435d3b65
commit 0920b65ddf
7 changed files with 43 additions and 20 deletions

View File

@@ -799,6 +799,8 @@ static struct cmd_t command_defs[] =
CMD_TAGS(
CMD_TAG_UI)
CMD_SYN(
"/wins",
"/wins unread",
"/wins tidy",
"/wins autotidy on|off",
"/wins prune",
@@ -807,6 +809,7 @@ static struct cmd_t command_defs[] =
"Manage windows. "
"Passing no argument will list all currently active windows and information about their usage.")
CMD_ARGS(
{ "unread", "List windows with unread messages." },
{ "tidy", "Move windows so there are no gaps." },
{ "autotidy on|off", "Automatically remove gaps when closing windows." },
{ "prune", "Close all windows with no unread messages, and then tidy so there are no gaps." },
@@ -2079,6 +2082,7 @@ cmd_init(void)
autocomplete_add(close_ac, "all");
wins_ac = autocomplete_new();
autocomplete_add(wins_ac, "unread");
autocomplete_add(wins_ac, "prune");
autocomplete_add(wins_ac, "tidy");
autocomplete_add(wins_ac, "autotidy");

View File

@@ -1013,7 +1013,9 @@ gboolean
cmd_wins(ProfWin *window, const char *const command, gchar **args)
{
if (args[0] == NULL) {
cons_show_wins();
cons_show_wins(FALSE);
} else if (strcmp(args[0], "unread") == 0) {
cons_show_wins(TRUE);
} else if (strcmp(args[0], "tidy") == 0) {
if (wins_tidy()) {
cons_show("Windows tidied.");