diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 18:34:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 18:34:56 +0000 |
commit | 04c60283c42618f8f97e49452e1022908b4ec5e6 (patch) | |
tree | 6fcd132deacb85230638cda68c85899e012cb0c2 | |
parent | f34b6190496ba8e6f1af82540eb6e6f1b34a7424 (diff) | |
download | rtmux-04c60283c42618f8f97e49452e1022908b4ec5e6.tar.gz rtmux-04c60283c42618f8f97e49452e1022908b4ec5e6.tar.bz2 rtmux-04c60283c42618f8f97e49452e1022908b4ec5e6.zip |
status is a toggle.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | cmd-set-option.c | 6 |
2 files changed, 7 insertions, 3 deletions
@@ -1,5 +1,7 @@ 04 June 2008 +* setw monitor-activity and set status without arguments now toggle the current + value; suggested by merdely. * New command set-window-option (alias setw) to set the single current window option: monitor-activity to determine whether window activity is shown in the status bar for that window (default off). @@ -399,4 +401,4 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.107 2008-06-04 17:54:26 nicm Exp $ +$Id: CHANGES,v 1.108 2008-06-04 18:34:56 nicm Exp $ diff --git a/cmd-set-option.c b/cmd-set-option.c index 8826a657..b2ef320b 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-option.c,v 1.21 2008-06-04 05:47:46 nicm Exp $ */ +/* $Id: cmd-set-option.c,v 1.22 2008-06-04 18:34:56 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -144,7 +144,7 @@ cmd_set_option_exec(void *ptr, unused struct cmd_ctx *ctx) strcasecmp(data->value, "no") == 0) bool = 0; } else - bool = 1; + bool = -2; if (strcmp(data->option, "prefix") == 0) { if (data->value == NULL) { @@ -162,6 +162,8 @@ cmd_set_option_exec(void *ptr, unused struct cmd_ctx *ctx) ctx->error(ctx, "bad value: %s", data->value); return; } + if (bool == -2) + bool = !options_get_number(oo, "status-lines"); options_set_number(oo, "status-lines", bool); recalculate_sizes(); } else if (strcmp(data->option, "status-fg") == 0) { |