summaryrefslogtreecommitdiffstats
path: root/cmd-set-window-option.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-16 17:35:40 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-16 17:35:40 +0000
commit55d5b83408de27485e6b2ecc311d9ff8eaae822b (patch)
tree58f63de5001cca24ae29fc488ee2a5ef4a9ab67b /cmd-set-window-option.c
parent1726bf0ffcda9f8911d0e6905c6dadd69d915525 (diff)
Informational messages on window option changes.
Diffstat (limited to 'cmd-set-window-option.c')
-rw-r--r--cmd-set-window-option.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/cmd-set-window-option.c b/cmd-set-window-option.c
index c92deac3..f762c117 100644
--- a/cmd-set-window-option.c
+++ b/cmd-set-window-option.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-set-window-option.c,v 1.7 2008-06-14 16:47:20 nicm Exp $ */
+/* $Id: cmd-set-window-option.c,v 1.8 2008-06-16 17:35:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -145,6 +145,14 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
wl->window->flags &= ~WINDOW_MONITOR;
}
+ if (wl->window->flags & WINDOW_MONITOR) {
+ ctx->info(ctx, "window %s:%d: set %s",
+ s->name, wl->idx, data->option);
+ } else {
+ ctx->info(ctx, "window %s:%d: cleared %s",
+ s->name, wl->idx, data->option);
+ }
+
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
s = ARRAY_ITEM(&sessions, i);
if (s != NULL)
@@ -165,6 +173,14 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
wl->window->flags &= ~WINDOW_AGGRESSIVE;
}
+ if (wl->window->flags & WINDOW_AGGRESSIVE) {
+ ctx->info(ctx, "window %s:%d: set %s",
+ s->name, wl->idx, data->option);
+ } else {
+ ctx->info(ctx, "window %s:%d: cleared %s",
+ s->name, wl->idx, data->option);
+ }
+
recalculate_sizes();
} else if (strcmp(data->option, "force-width") == 0) {
if (data->value == NULL || number == -1) {
@@ -179,6 +195,10 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
wl->window->limitx = UINT_MAX;
else
wl->window->limitx = number;
+
+ ctx->info(ctx, "window %s:%d: set force-width %u",
+ s->name, wl->idx, number);
+
recalculate_sizes();
} else if (strcmp(data->option, "force-height") == 0) {
if (data->value == NULL || number == -1) {
@@ -193,6 +213,10 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
wl->window->limity = UINT_MAX;
else
wl->window->limity = number;
+
+ ctx->info(ctx, "window %s:%d: set force-height %u",
+ s->name, wl->idx, number);
+
recalculate_sizes();
} else {
ctx->error(ctx, "unknown option: %s", data->option);