summaryrefslogtreecommitdiffstats
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-11-05 09:06:31 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-11-05 09:06:31 +0000
commite5bf63cb59981657e5140c0f542ec3c1f69dcd5a (patch)
treedd183a94f88aebd012e07d2bd9d4990d0e910566 /status.c
parente5d6df8979dfbfb390511f31dcc40126bc5b5c6d (diff)
Option to change status line (message) background when using vi keys and
in command mode. From Ben Boeckel.
Diffstat (limited to 'status.c')
-rw-r--r--status.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/status.c b/status.c
index 50e7302e..86f7e8c9 100644
--- a/status.c
+++ b/status.c
@@ -919,9 +919,16 @@ status_prompt_redraw(struct client *c)
off = 0;
memcpy(&gc, &grid_default_cell, sizeof gc);
- colour_set_fg(&gc, options_get_number(&s->options, "message-fg"));
- colour_set_bg(&gc, options_get_number(&s->options, "message-bg"));
- gc.attr |= options_get_number(&s->options, "message-attr");
+ /* Change colours for command mode. */
+ if (c->prompt_mdata.mode == 1) {
+ colour_set_fg(&gc, options_get_number(&s->options, "message-command-fg"));
+ colour_set_bg(&gc, options_get_number(&s->options, "message-command-bg"));
+ gc.attr |= options_get_number(&s->options, "message-command-attr");
+ } else {
+ colour_set_fg(&gc, options_get_number(&s->options, "message-fg"));
+ colour_set_bg(&gc, options_get_number(&s->options, "message-bg"));
+ gc.attr |= options_get_number(&s->options, "message-attr");
+ }
screen_write_start(&ctx, NULL, &c->status);
@@ -977,7 +984,12 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
}
break;
+ case MODEKEYEDIT_SWITCHMODE:
+ c->flags |= CLIENT_STATUS;
+ break;
case MODEKEYEDIT_SWITCHMODEAPPEND:
+ c->flags |= CLIENT_STATUS;
+ /* FALLTHROUGH */
case MODEKEYEDIT_CURSORRIGHT:
if (c->prompt_index < size) {
c->prompt_index++;