mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 19:58:48 +00:00
Add a cmdq_continue function rather than twiddling the flag directly.
This commit is contained in:
parent
03da0ced46
commit
9272fe36e2
2
cfg.c
2
cfg.c
@ -53,7 +53,7 @@ cfg_done(__unused struct cmdq_item *item, __unused void *data)
|
||||
cfg_show_causes(RB_MIN(sessions, &sessions));
|
||||
|
||||
if (cfg_item != NULL)
|
||||
cfg_item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(cfg_item);
|
||||
|
||||
status_prompt_load_history();
|
||||
|
||||
|
@ -188,7 +188,7 @@ cmd_display_panes_free(struct client *c)
|
||||
struct cmd_display_panes_data *cdata = c->overlay_data;
|
||||
|
||||
if (cdata->item != NULL)
|
||||
cdata->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(cdata->item);
|
||||
free(cdata->command);
|
||||
free(cdata);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ cmd_if_shell_callback(struct job *job)
|
||||
|
||||
out:
|
||||
if (cdata->item != NULL)
|
||||
cdata->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(cdata->item);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -176,7 +176,7 @@ cmd_load_buffer_callback(struct client *c, int closed, void *data)
|
||||
free(cause);
|
||||
}
|
||||
out:
|
||||
cdata->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(cdata->item);
|
||||
|
||||
free(cdata->bufname);
|
||||
free(cdata);
|
||||
|
@ -156,6 +156,13 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item,
|
||||
free(name);
|
||||
}
|
||||
|
||||
/* Continue processing command queue. */
|
||||
void
|
||||
cmdq_continue(struct cmdq_item *item)
|
||||
{
|
||||
item->flags &= ~CMDQ_WAITING;
|
||||
}
|
||||
|
||||
/* Remove an item. */
|
||||
static void
|
||||
cmdq_remove(struct cmdq_item *item)
|
||||
|
@ -155,7 +155,7 @@ cmd_run_shell_callback(struct job *job)
|
||||
free(msg);
|
||||
|
||||
if (cdata->item != NULL)
|
||||
cdata->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(cdata->item);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -153,7 +153,7 @@ cmd_wait_for_signal(__unused struct cmdq_item *item, const char *name,
|
||||
log_debug("signal wait channel %s, with waiters", wc->name);
|
||||
|
||||
TAILQ_FOREACH_SAFE(wi, &wc->waiters, entry, wi1) {
|
||||
wi->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(wi->item);
|
||||
|
||||
TAILQ_REMOVE(&wc->waiters, wi, entry);
|
||||
free(wi);
|
||||
@ -229,7 +229,7 @@ cmd_wait_for_unlock(struct cmdq_item *item, const char *name,
|
||||
}
|
||||
|
||||
if ((wi = TAILQ_FIRST(&wc->lockers)) != NULL) {
|
||||
wi->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(wi->item);
|
||||
TAILQ_REMOVE(&wc->lockers, wi, entry);
|
||||
free(wi);
|
||||
} else {
|
||||
@ -248,13 +248,13 @@ cmd_wait_for_flush(void)
|
||||
|
||||
RB_FOREACH_SAFE(wc, wait_channels, &wait_channels, wc1) {
|
||||
TAILQ_FOREACH_SAFE(wi, &wc->waiters, entry, wi1) {
|
||||
wi->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(wi->item);
|
||||
TAILQ_REMOVE(&wc->waiters, wi, entry);
|
||||
free(wi);
|
||||
}
|
||||
wc->woken = 1;
|
||||
TAILQ_FOREACH_SAFE(wi, &wc->lockers, entry, wi1) {
|
||||
wi->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(wi->item);
|
||||
TAILQ_REMOVE(&wc->lockers, wi, entry);
|
||||
free(wi);
|
||||
}
|
||||
|
2
menu.c
2
menu.c
@ -161,7 +161,7 @@ menu_free_cb(struct client *c)
|
||||
struct menu_data *md = c->overlay_data;
|
||||
|
||||
if (md->item != NULL)
|
||||
md->item->flags &= ~CMDQ_WAITING;
|
||||
cmdq_continue(md->item);
|
||||
|
||||
if (md->cb != NULL)
|
||||
md->cb(md->menu, UINT_MAX, KEYC_NONE, md->data);
|
||||
|
1
tmux.h
1
tmux.h
@ -2037,6 +2037,7 @@ void cmdq_insert_after(struct cmdq_item *, struct cmdq_item *);
|
||||
void cmdq_append(struct client *, struct cmdq_item *);
|
||||
void cmdq_insert_hook(struct session *, struct cmdq_item *,
|
||||
struct cmd_find_state *, const char *, ...);
|
||||
void cmdq_continue(struct cmdq_item *);
|
||||
void printflike(3, 4) cmdq_format(struct cmdq_item *, const char *,
|
||||
const char *, ...);
|
||||
u_int cmdq_next(struct client *);
|
||||
|
Loading…
Reference in New Issue
Block a user