Disable UTF-8 by default and add options to enable it.

This commit is contained in:
Nicholas Marriott
2008-11-16 13:28:59 +00:00
parent 46f5e42145
commit 5ca710d9e3
10 changed files with 66 additions and 13 deletions

View File

@ -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>
@ -181,6 +181,30 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
s->name, wl->idx, data->option);
}
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) {