mirror of
https://github.com/tmux/tmux.git
synced 2025-12-24 17:56:02 +00:00
Add {current}/{active} for -t for current window or active pane, from
Manuel Einfalt in GitHub issue 4766.
This commit is contained in:
15
cmd-find.c
15
cmd-find.c
@@ -925,6 +925,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
||||
const char *target, enum cmd_find_type type, int flags)
|
||||
{
|
||||
struct mouse_event *m;
|
||||
struct client *c;
|
||||
struct cmd_find_state current;
|
||||
char *colon, *period, *copy = NULL, tmp[256];
|
||||
const char *session, *window, *pane, *s;
|
||||
@@ -991,6 +992,20 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
||||
if (target == NULL || *target == '\0')
|
||||
goto current;
|
||||
|
||||
if (strcmp(target, "@") == 0 ||
|
||||
strcmp(target, "{active}") == 0 ||
|
||||
strcmp(target, "{current}") == 0) {
|
||||
c = cmdq_get_client(item);
|
||||
if (c == NULL) {
|
||||
cmdq_error(item, "no current client");
|
||||
goto error;
|
||||
}
|
||||
fs->wl = c->session->curw;
|
||||
fs->wp = c->session->curw->window->active;
|
||||
fs->w = c->session->curw->window;
|
||||
goto found;
|
||||
}
|
||||
|
||||
/* Mouse target is a plain = or {mouse}. */
|
||||
if (strcmp(target, "=") == 0 || strcmp(target, "{mouse}") == 0) {
|
||||
m = &cmdq_get_event(item)->m;
|
||||
|
||||
Reference in New Issue
Block a user