This allows one to select the last window (not last-window but window with
highest index), so one can bind it to 'select-window -t:$' to jump to the end
window, and similary bind to 'select-window -t:^' to jump to the first window
(first determined by base-index).

Signed-off-by: Raghavendra D Prabhu <rpra...@wnohang.net>

diff --git a/cmd.c b/cmd.c
index 4a17ddc..0077555 100644
--- a/cmd.c
+++ b/cmd.c
@@ -850,6 +850,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
-- 
1.8.0.2


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to