mirror of
https://github.com/tmux/tmux.git
synced 2025-04-17 01:08:49 +00:00
Don't copy marked pane when can just point to it.
This commit is contained in:
parent
12da13c9d1
commit
56d097cfe0
19
cmd-find.c
19
cmd-find.c
@ -873,22 +873,23 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_q *cmdq,
|
|||||||
log_debug("%s: target %s, type %d", __func__, target, type);
|
log_debug("%s: target %s, type %d", __func__, target, type);
|
||||||
log_debug("%s: cmdq %p, flags %#x", __func__, cmdq, flags);
|
log_debug("%s: cmdq %p, flags %#x", __func__, cmdq, flags);
|
||||||
|
|
||||||
|
/* Clear new state. */
|
||||||
|
cmd_find_clear_state(fs, cmdq, flags);
|
||||||
|
|
||||||
/* Find current state. */
|
/* Find current state. */
|
||||||
cmd_find_clear_state(¤t, cmdq, flags);
|
fs->current = NULL;
|
||||||
if (server_check_marked() && (flags & CMD_FIND_DEFAULT_MARKED))
|
if (server_check_marked() && (flags & CMD_FIND_DEFAULT_MARKED))
|
||||||
cmd_find_copy_state(¤t, &marked_pane);
|
fs->current = &marked_pane;
|
||||||
else {
|
if (fs->current == NULL) {
|
||||||
|
cmd_find_clear_state(¤t, cmdq, flags);
|
||||||
if (cmd_find_current_session(¤t) != 0) {
|
if (cmd_find_current_session(¤t) != 0) {
|
||||||
if (~flags & CMD_FIND_QUIET)
|
if (~flags & CMD_FIND_QUIET)
|
||||||
cmdq_error(cmdq, "no current session");
|
cmdq_error(cmdq, "no current session");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
fs->current = ¤t;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear new state. */
|
|
||||||
cmd_find_clear_state(fs, cmdq, flags);
|
|
||||||
fs->current = ¤t;
|
|
||||||
|
|
||||||
/* An empty or NULL target is the current. */
|
/* An empty or NULL target is the current. */
|
||||||
if (target == NULL || *target == '\0')
|
if (target == NULL || *target == '\0')
|
||||||
goto current;
|
goto current;
|
||||||
@ -1087,9 +1088,9 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_q *cmdq,
|
|||||||
|
|
||||||
current:
|
current:
|
||||||
/* Use the current session. */
|
/* Use the current session. */
|
||||||
|
cmd_find_copy_state(fs, fs->current);
|
||||||
if (flags & CMD_FIND_WINDOW_INDEX)
|
if (flags & CMD_FIND_WINDOW_INDEX)
|
||||||
current.idx = -1;
|
fs->idx = -1;
|
||||||
memcpy(fs, ¤t, sizeof *fs);
|
|
||||||
goto found;
|
goto found;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
Loading…
Reference in New Issue
Block a user