From 854e8ae04d15c16b688ba38119656aee134548dd Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 24 Dec 2012 12:38:57 +0000 Subject: Add ^ and $ special command targets to select lowest and highest numbered windows, from Raghavendra D Prabhu. --- cmd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd.c') diff --git a/cmd.c b/cmd.c index a9594c07..c0888a2c 100644 --- a/cmd.c +++ b/cmd.c @@ -863,6 +863,10 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp) wl = s->curw; else if (winptr[0] == '!' && winptr[1] == '\0') wl = TAILQ_FIRST(&s->lastw); + else if (winptr[0] == '^' && winptr[1] == '\0') + wl = RB_MIN(winlinks, &s->windows); + else if (winptr[0] == '$' && winptr[1] == '\0') + wl = RB_MAX(winlinks, &s->windows); else if (winptr[0] == '+' || winptr[0] == '-') wl = cmd_find_window_offset(winptr, s, &ambiguous); else -- cgit