summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-12-24 12:38:58 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-12-24 12:38:58 +0000
commitd5af3888f41f7abc0ee4571eb3940bc1227fc657 (patch)
treed9c54923215458ef868934fed87b0a20c27fd882 /usr.bin/tmux/cmd.c
parent8114c656726aa7d6c8b0182a06a59f377f0c2a2a (diff)
Add ^ and $ special command targets to select lowest and highest
numbered windows, from Raghavendra D Prabhu.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r--usr.bin/tmux/cmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index cd46d13cec2..d1f1da30cc2 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.72 2012/11/27 09:20:03 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.73 2012/12/24 12:38:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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