aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c10
-rw-r--r--src/command/commands.c17
-rw-r--r--src/command/commands.h1
3 files changed, 26 insertions, 2 deletions
diff --git a/src/command/command.c b/src/command/command.c
index bd0d741c..25571e81 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -684,6 +684,14 @@ static struct cmd_t command_defs[] =
"Enable or disable word wrapping in the main window.",
NULL } } },
+ { "/winstidy",
+ cmd_winstidy, parse_args, 1, 1, &cons_winstidy_setting,
+ { "/winstidy on|off", "Auto tidy windows.",
+ { "/winstidy on|off",
+ "------------",
+ "Enable or disable auto window tidy.",
+ NULL } } },
+
{ "/time",
cmd_time, parse_args, 1, 2, &cons_time_setting,
{ "/time setting|statusbar [setting]", "Time display.",
@@ -1921,7 +1929,7 @@ _cmd_complete_parameters(const char * const input)
// autocomplete boolean settings
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype",
"/flash", "/splash", "/chlog", "/grlog", "/mouse", "/history",
- "/vercheck", "/privileges", "/presence", "/wrap", "/carbons" };
+ "/vercheck", "/privileges", "/presence", "/wrap", "/winstidy", "/carbons" };
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice);
diff --git a/src/command/commands.c b/src/command/commands.c
index b942acd4..89ded432 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -719,6 +719,16 @@ cmd_wins(gchar **args, struct cmd_help_t help)
}
gboolean
+cmd_winstidy(gchar **args, struct cmd_help_t help)
+{
+ gboolean result = _cmd_set_boolean_preference(args[0], help, "Wins Auto Tidy", PREF_WINS_AUTO_TIDY);
+
+ wins_resize_all();
+
+ return result;
+}
+
+gboolean
cmd_win(gchar **args, struct cmd_help_t help)
{
int num = atoi(args[0]);
@@ -804,7 +814,7 @@ cmd_help(gchar **args, struct cmd_help_t help)
"/carbons", "/chlog", "/flash", "/gone", "/grlog", "/history", "/intype",
"/log", "/mouse", "/notify", "/outtype", "/prefs", "/priority",
"/reconnect", "/roster", "/splash", "/states", "/statuses", "/theme",
- "/titlebar", "/vercheck", "/privileges", "/occupants", "/presence", "/wrap" };
+ "/titlebar", "/vercheck", "/privileges", "/occupants", "/presence", "/wrap", "/winstidy" };
_cmd_show_filtered_help("Settings commands", filter, ARRAY_SIZE(filter));
} else if (strcmp(args[0], "navigation") == 0) {
@@ -3242,6 +3252,11 @@ cmd_close(gchar **args, struct cmd_help_t help)
ui_close_win(index);
cons_show("Closed window %d", index);
+ // Tidy up the window list.
+ if (prefs_get_boolean(PREF_WINS_AUTO_TIDY)) {
+ ui_tidy_wins();
+ }
+
return TRUE;
}
diff --git a/src/command/commands.h b/src/command/commands.h
index 7b7e7c93..fb5372a6 100644
--- a/src/command/commands.h
+++ b/src/command/commands.h
@@ -125,6 +125,7 @@ gboolean cmd_vercheck(gchar **args, struct cmd_help_t help);
gboolean cmd_who(gchar **args, struct cmd_help_t help);
gboolean cmd_win(gchar **args, struct cmd_help_t help);
gboolean cmd_wins(gchar **args, struct cmd_help_t help);
+gboolean cmd_winstidy(gchar **args, struct cmd_help_t help);
gboolean cmd_xa(gchar **args, struct cmd_help_t help);
gboolean cmd_alias(gchar **args, struct cmd_help_t help);
gboolean cmd_xmlconsole(gchar **args, struct cmd_help_t help);