mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 04:27:00 +00:00
Log error properly when no current state, and some other minor tweaks.
This commit is contained in:
@ -974,9 +974,8 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
|||||||
fs->current = ¤t;
|
fs->current = ¤t;
|
||||||
log_debug("%s: current is from client", __func__);
|
log_debug("%s: current is from client", __func__);
|
||||||
} else
|
} else
|
||||||
return (-1);
|
goto error;
|
||||||
if (!cmd_find_empty_state(fs->current) &&
|
if (!cmd_find_valid_state(fs->current))
|
||||||
!cmd_find_valid_state(fs->current))
|
|
||||||
fatalx("invalid current find state");
|
fatalx("invalid current find state");
|
||||||
|
|
||||||
/* An empty or NULL target is the current. */
|
/* An empty or NULL target is the current. */
|
||||||
|
@ -203,14 +203,14 @@ cmdq_fire_command(struct cmdq_item *item)
|
|||||||
flags = !!(cmd->flags & CMD_CONTROL);
|
flags = !!(cmd->flags & CMD_CONTROL);
|
||||||
cmdq_guard(item, "begin", flags);
|
cmdq_guard(item, "begin", flags);
|
||||||
|
|
||||||
|
if (item->client == NULL)
|
||||||
|
item->client = cmd_find_client(item, NULL, 1);
|
||||||
|
|
||||||
if (cmd_prepare_state(cmd, item) != 0) {
|
if (cmd_prepare_state(cmd, item) != 0) {
|
||||||
retval = CMD_RETURN_ERROR;
|
retval = CMD_RETURN_ERROR;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->client == NULL)
|
|
||||||
item->client = cmd_find_client(item, NULL, 1);
|
|
||||||
|
|
||||||
retval = cmd->entry->exec(cmd, item);
|
retval = cmd->entry->exec(cmd, item);
|
||||||
if (retval == CMD_RETURN_ERROR)
|
if (retval == CMD_RETURN_ERROR)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -950,9 +950,6 @@ retry:
|
|||||||
if (KEYC_IS_MOUSE(key) && m->valid && wp != NULL) {
|
if (KEYC_IS_MOUSE(key) && m->valid && wp != NULL) {
|
||||||
cmd_find_from_winlink_pane(&fs, s->curw, wp);
|
cmd_find_from_winlink_pane(&fs, s->curw, wp);
|
||||||
cmd_find_log_state(__func__, &fs);
|
cmd_find_log_state(__func__, &fs);
|
||||||
|
|
||||||
if (!cmd_find_valid_state(&fs))
|
|
||||||
fatalx("invalid key state");
|
|
||||||
key_bindings_dispatch(bd, c, m, &fs);
|
key_bindings_dispatch(bd, c, m, &fs);
|
||||||
} else
|
} else
|
||||||
key_bindings_dispatch(bd, c, m, NULL);
|
key_bindings_dispatch(bd, c, m, NULL);
|
||||||
|
Reference in New Issue
Block a user