mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Provide an accessor for the running queue item and use it to not let
hooks recurse.
This commit is contained in:
9
notify.c
9
notify.c
@ -158,7 +158,11 @@ notify_add(const char *name, struct cmd_find_state *fs, struct client *c,
|
||||
struct session *s, struct window *w, struct window_pane *wp)
|
||||
{
|
||||
struct notify_entry *ne;
|
||||
struct cmdq_item *new_item;
|
||||
struct cmdq_item *item;
|
||||
|
||||
item = cmdq_running(NULL);
|
||||
if (item != NULL && (cmdq_get_flags(item) & CMDQ_STATE_NOHOOKS))
|
||||
return;
|
||||
|
||||
ne = xcalloc(1, sizeof *ne);
|
||||
ne->name = xstrdup(name);
|
||||
@ -183,8 +187,7 @@ notify_add(const char *name, struct cmd_find_state *fs, struct client *c,
|
||||
if (ne->fs.s != NULL) /* cmd_find_valid_state needs session */
|
||||
session_add_ref(ne->fs.s, __func__);
|
||||
|
||||
new_item = cmdq_get_callback(notify_callback, ne);
|
||||
cmdq_append(NULL, new_item);
|
||||
cmdq_append(NULL, cmdq_get_callback(notify_callback, ne));
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user