mirror of
https://github.com/tmux/tmux.git
synced 2026-10-10 12:14:43 +00:00
Allow simple commands to be fired.
This commit is contained in:
12
cfg.c
12
cfg.c
@@ -98,6 +98,7 @@ load_cfg(const char *path, struct cmdq_item *item,
|
||||
{
|
||||
FILE *f;
|
||||
struct cmd_parse_input pi;
|
||||
struct cmd_invoke_input ci;
|
||||
struct cmd_parse_tree *tree;
|
||||
struct cmdq_item *new_item0;
|
||||
struct cmdq_state *state;
|
||||
@@ -137,7 +138,10 @@ load_cfg(const char *path, struct cmdq_item *item,
|
||||
state = cmdq_new_state(NULL, NULL, 0);
|
||||
cmdq_add_format(state, "current_file", "%s", pi.file);
|
||||
|
||||
new_item0 = cmd_invoke_get(tree, state, 0, NULL);
|
||||
memset(&ci, 0, sizeof ci);
|
||||
ci.file = pi.file;
|
||||
ci.flags = flags;
|
||||
new_item0 = cmd_invoke_get(tree, state, &ci);
|
||||
if (item != NULL)
|
||||
new_item0 = cmdq_insert_after(item, new_item0);
|
||||
else
|
||||
@@ -156,6 +160,7 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
|
||||
struct cmdq_item **new_item)
|
||||
{
|
||||
struct cmd_parse_input pi;
|
||||
struct cmd_invoke_input ci;
|
||||
struct cmd_parse_tree *tree;
|
||||
struct cmdq_item *new_item0;
|
||||
struct cmdq_state *state;
|
||||
@@ -188,7 +193,10 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
|
||||
state = cmdq_new_state(NULL, NULL, 0);
|
||||
cmdq_add_format(state, "current_file", "%s", pi.file);
|
||||
|
||||
new_item0 = cmd_invoke_get(tree, state, 0, NULL);
|
||||
memset(&ci, 0, sizeof ci);
|
||||
ci.file = pi.file;
|
||||
ci.flags = flags;
|
||||
new_item0 = cmd_invoke_get(tree, state, &ci);
|
||||
if (item != NULL)
|
||||
new_item0 = cmdq_insert_after(item, new_item0);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user