mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Sync OpenBSD patchset 261:
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.
This commit is contained in:
13
status.c
13
status.c
@ -1,4 +1,4 @@
|
||||
/* $Id: status.c,v 1.109 2009-08-09 17:40:17 tcunha Exp $ */
|
||||
/* $Id: status.c,v 1.110 2009-08-16 19:29:24 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -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);
|
||||
|
Reference in New Issue
Block a user