From 163908fe8a0af8cf2d24510415bd4f81ace3a4d1 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 12 Aug 2021 08:05:11 +0000 Subject: Move hook format setup earlier and add a hook_client, GitHub issue 2809. --- cmd-queue.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmd-queue.c') diff --git a/cmd-queue.c b/cmd-queue.c index 54163919..6dd5f9dd 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -269,6 +269,15 @@ cmdq_add_format(struct cmdq_state *state, const char *key, const char *fmt, ...) free(value); } +/* Add formats to command queue. */ +void +cmdq_add_formats(struct cmdq_state *state, struct format_tree *ft) +{ + if (state->formats == NULL) + state->formats = format_create(NULL, NULL, FORMAT_NONE, 0); + format_merge(state->formats, ft); +} + /* Merge formats from item. */ void cmdq_merge_formats(struct cmdq_item *item, struct format_tree *ft) -- cgit