mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Replace the various identical error callbacks with a single one in cmd-queue.c.
This commit is contained in:
@ -182,17 +182,6 @@ cmd_display_panes_draw(struct client *c, struct screen_redraw_ctx *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
static enum cmd_retval
|
||||
cmd_display_panes_error(struct cmdq_item *item, void *data)
|
||||
{
|
||||
char *error = data;
|
||||
|
||||
cmdq_error(item, "%s", error);
|
||||
free(error);
|
||||
|
||||
return (CMD_RETURN_NORMAL);
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_display_panes_free(struct client *c)
|
||||
{
|
||||
@ -226,11 +215,13 @@ cmd_display_panes_key(struct client *c, struct key_event *event)
|
||||
cmd = cmd_template_replace(cdata->command, expanded, 1);
|
||||
|
||||
cmdlist = cmd_string_parse(cmd, NULL, 0, &cause);
|
||||
if (cmdlist == NULL && cause != NULL)
|
||||
new_item = cmdq_get_callback(cmd_display_panes_error, cause);
|
||||
else if (cmdlist == NULL)
|
||||
new_item = NULL;
|
||||
else {
|
||||
if (cmdlist == NULL) {
|
||||
if (cause != NULL)
|
||||
new_item = cmdq_get_error(cause);
|
||||
else
|
||||
new_item = NULL;
|
||||
free(cause);
|
||||
} else {
|
||||
new_item = cmdq_get_command(cmdlist, NULL, NULL, 0);
|
||||
cmd_list_free(cmdlist);
|
||||
}
|
||||
|
Reference in New Issue
Block a user