mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 22:43:58 +00:00
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.
This commit is contained in:
14
status.c
14
status.c
@ -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:
|
||||
|
Reference in New Issue
Block a user