summaryrefslogtreecommitdiffstats
path: root/cmd-set-window-option.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-11-16 13:28:59 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-11-16 13:28:59 +0000
commit5ca710d9e3284393dfbd294915e9e4251b0fe728 (patch)
treea7d6dc2e37673d14fe88ec6bf68e644271c67e92 /cmd-set-window-option.c
parent46f5e42145ed34567b29c73032adbd8a41f5dfa2 (diff)
Disable UTF-8 by default and add options to enable it.
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 018d0809..cafce6bb 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.12 2008-09-25 23:28:15 nicm Exp $ */
+/* $Id: cmd-set-window-option.c,v 1.13 2008-11-16 13:28:59 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -182,6 +182,30 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
}
recalculate_sizes();
+ } else if (strcmp(data->option, "utf8") == 0) {
+ if (flag == -1) {
+ ctx->error(ctx, "bad value: %s", data->value);
+ return;
+ }
+
+ if (flag == -2)
+ wl->window->flags ^= WINDOW_UTF8;
+ else {
+ if (flag)
+ wl->window->flags |= WINDOW_UTF8;
+ else
+ wl->window->flags &= ~WINDOW_UTF8;
+ }
+
+ if (wl->window->flags & WINDOW_UTF8) {
+ 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) {
ctx->error(ctx, "invalid value");