aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-08-13 23:44:18 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-08-13 23:44:18 +0000
commit09cbd0c695cdd953834a46d161f6d3b0bf385c1c (patch)
tree547649ceb2c777efe0cb20b2f2cae7ae0d7e1108 /status.c
parent7a359c00aca2e35dc26c2239f4261f0fa53f0caf (diff)
downloadrtmux-09cbd0c695cdd953834a46d161f6d3b0bf385c1c.tar.gz
rtmux-09cbd0c695cdd953834a46d161f6d3b0bf385c1c.tar.bz2
rtmux-09cbd0c695cdd953834a46d161f6d3b0bf385c1c.zip
Switch the prompt code to return an empty string when the user enters no
response and reserve NULL for an explicit cancel. Change all callbacks to treat them the same so no functional change. Also add cancel key bindings to emacs mode which were missing.
Diffstat (limited to 'status.c')
-rw-r--r--status.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/status.c b/status.c
index 47a5d8e4..c42dc896 100644
--- a/status.c
+++ b/status.c
@@ -920,14 +920,11 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
break;
case MODEKEYEDIT_ENTER:
- if (*c->prompt_buffer != '\0') {
+ if (*c->prompt_buffer != '\0')
status_prompt_add_history(c);
- if (c->prompt_callbackfn(
- c->prompt_data, c->prompt_buffer) == 0)
- status_prompt_clear(c);
- break;
- }
- /* FALLTHROUGH */
+ if (c->prompt_callbackfn(c->prompt_data, c->prompt_buffer) == 0)
+ status_prompt_clear(c);
+ break;
case MODEKEYEDIT_CANCEL:
if (c->prompt_callbackfn(c->prompt_data, NULL) == 0)
status_prompt_clear(c);