diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-27 17:27:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-27 17:27:36 +0000 |
commit | 5d1b6888dc11a201129a87cfe22ee514597eacf3 (patch) | |
tree | 250f66882982bac3d766850f6742dca59c9f326f /status.c | |
parent | 1f2d9e64bb292438ba9a618fd93baedc5e84eca1 (diff) | |
download | rtmux-5d1b6888dc11a201129a87cfe22ee514597eacf3.tar.gz rtmux-5d1b6888dc11a201129a87cfe22ee514597eacf3.tar.bz2 rtmux-5d1b6888dc11a201129a87cfe22ee514597eacf3.zip |
Convert hidden flag to a full flags word for the status line and add a flag to
accept after only one key. Use this so don't need to press enter after y/n for
confirm-before.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.76 2009-04-27 13:56:51 tcunha Exp $ */ +/* $Id: status.c,v 1.77 2009-04-27 17:27:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -563,7 +563,7 @@ status_message_redraw(struct client *c) void status_prompt_set(struct client *c, - const char *msg, int (*fn)(void *, const char *), void *data, int hide) + const char *msg, int (*fn)(void *, const char *), void *data, int flags) { c->prompt_string = xstrdup(msg); @@ -575,7 +575,7 @@ status_prompt_set(struct client *c, c->prompt_hindex = 0; - c->prompt_hidden = hide; + c->prompt_flags = flags; mode_key_init(&c->prompt_mdata, options_get_number(&c->session->options, "status-keys"), @@ -644,7 +644,7 @@ status_prompt_redraw(struct client *c) left--; size = left; } - if (c->prompt_hidden) { + if (c->prompt_flags & PROMPT_HIDDEN) { n = strlen(c->prompt_buffer); if (n > left) n = left; @@ -844,6 +844,12 @@ status_prompt_key(struct client *c, int key) c->prompt_buffer[c->prompt_index++] = key; } + if (c->prompt_flags & PROMPT_SINGLE) { + if (c->prompt_callback( + c->prompt_data, c->prompt_buffer) == 0) + status_prompt_clear(c); + } + c->flags |= CLIENT_STATUS; break; default: |