The branch, master has been updated
       via  854e8ae04d15c16b688ba38119656aee134548dd (commit)
       via  3e6d45acf67e37db3614a581ab5aaa3b9509a430 (commit)
       via  a2c8af97e9b1f2ade071de31d97eccc3219949d9 (commit)
       via  b18ff676469e197000cd89965c41f015b47862da (commit)
      from  6a5adfc0baeb178a1b785068e118a524284498f4 (commit)

- Log -----------------------------------------------------------------
commit 854e8ae04d15c16b688ba38119656aee134548dd
Author: Nicholas Marriott <n...@openbsd.org>
Commit: Nicholas Marriott <n...@openbsd.org>

    Add ^ and $ special command targets to select lowest and highest
    numbered windows, from Raghavendra D Prabhu.
---
 cmd.c  |    4 ++++
 tmux.1 |   19 ++++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/cmd.c b/cmd.c
index a9594c0..c0888a2 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
diff --git a/tmux.1 b/tmux.1
index 349c23f..7abb8f8 100644
--- a/tmux.1
+++ b/tmux.1
@@ -408,11 +408,15 @@ otherwise the current window in
 is chosen.
 The special character
 .Ql \&!
-uses the last (previously current) window, or
+uses the last (previously current) window,
+.Ql ^
+selects the highest numbered window,
+.Ql $
+selects the lowest numbered window, and
 .Ql +
 and
 .Ql -
-are the next window or the previous window by number.
+select the next window or the previous window by number.
 When the argument does not contain a colon,
 .Nm
 first attempts to parse it as window; if that fails, an attempt is made to
@@ -1126,6 +1130,7 @@ This command works only from inside
 .Ic choose-tree
 .Op Fl s
 .Op Fl w
+.Op Fl u
 .Op Fl b Ar session-template
 .Op Fl c Ar window-template
 .Op Fl S Ar format
@@ -1151,6 +1156,9 @@ If
 .Fl w
 is given, will show windows.
 If
+.Fl u
+is given, the tree is uncollapsed by default.
+If
 .Fl b
 is given, will override the default session command.
 Note that
@@ -1639,7 +1647,7 @@ is the same as using the
 .Ic last-pane
 command.
 .It Xo Ic select-window
-.Op Fl lnp
+.Op Fl lnpT
 .Op Fl t Ar target-window
 .Xc
 .D1 (alias: Ic selectw )
@@ -1655,6 +1663,11 @@ are equivalent to the
 and
 .Ic previous-window
 commands.
+If
+.Fl T
+is given and the selected window is already the current window,
+the command behaves like
+.Ic last-window .
 .It Xo Ic split-window
 .Op Fl dhvP
 .Op Fl c Ar start-directory


commit 3e6d45acf67e37db3614a581ab5aaa3b9509a430
Author: Nicholas Marriott <n...@openbsd.org>
Commit: Nicholas Marriott <n...@openbsd.org>

    Add -T option to select-window to toggle to last window if already
    current, from Raghavendra D Prabhu.
---
 cmd-select-window.c |   16 +++++++++++++---
 window-choose.c     |    2 --
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/cmd-select-window.c b/cmd-select-window.c
index eaa3e88..70d60be 100644
--- a/cmd-select-window.c
+++ b/cmd-select-window.c
@@ -31,8 +31,8 @@ enum cmd_retval        cmd_select_window_exec(struct cmd *, 
struct cmd_ctx *);
 
 const struct cmd_entry cmd_select_window_entry = {
        "select-window", "selectw",
-       "lnpt:", 0, 0,
-       "[-lnp] " CMD_TARGET_WINDOW_USAGE,
+       "lnpTt:", 0, 0,
+       "[-lnpT] " CMD_TARGET_WINDOW_USAGE,
        0,
        cmd_select_window_key_binding,
        NULL,
@@ -130,7 +130,17 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx 
*ctx)
                if (wl == NULL)
                        return (CMD_RETURN_ERROR);
 
-               if (session_select(s, wl->idx) == 0)
+               /*
+                * If -T and select-window is invoked on same window as
+                * current, switch to previous window.
+                */
+               if (args_has(self->args, 'T') && wl == s->curw) {
+                       if (session_last(s) != 0) {
+                               ctx->error(ctx, "no last window");
+                               return (-1);
+                       }
+                       server_redraw_session(s);
+               } else if (session_select(s, wl->idx) == 0)
                        server_redraw_session(s);
        }
        recalculate_sizes();
diff --git a/window-choose.c b/window-choose.c
index ab0d803..20482a6 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -43,7 +43,6 @@ void  window_choose_scroll_down(struct window_pane *);
 void   window_choose_collapse(struct window_pane *, struct session *);
 void   window_choose_expand(struct window_pane *, struct session *, u_int);
 void   window_choose_collapse_all(struct window_pane *);
-void   window_choose_expand_all(struct window_pane *);
 
 enum window_choose_input_type {
        WINDOW_CHOOSE_NORMAL = -1,
@@ -118,7 +117,6 @@ window_choose_ready(struct window_pane *wp, u_int cur,
        ARRAY_CONCAT(&data->old_list, &data->list);
 
        window_choose_collapse_all(wp);
-       window_choose_redraw_screen(wp);
 }
 
 struct screen *


commit a2c8af97e9b1f2ade071de31d97eccc3219949d9
Author: Nicholas Marriott <n...@openbsd.org>
Commit: Nicholas Marriott <n...@openbsd.org>

    Add missing function prototype.
---
 tmux.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tmux.h b/tmux.h
index 429f2d7..c1fec02 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2243,6 +2243,7 @@ struct window_choose_data 
*window_choose_add_session(struct window_pane *,
 struct window_choose_data      *window_choose_add_item(struct window_pane *,
                        struct cmd_ctx *, struct winlink *, const char *,
                        char *, u_int);
+void   window_choose_expand_all(struct window_pane *);
 
 /* names.c */
 void            queue_window_name(struct window *);


commit b18ff676469e197000cd89965c41f015b47862da
Author: Nicholas Marriott <n...@openbsd.org>
Commit: Nicholas Marriott <n...@openbsd.org>

    Add a -u flag to choose-tree to start uncollapsed, from Raghavendra D
    Prabhu.
---
 cmd-choose-tree.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c
index 52f06dc..24c4299 100644
--- a/cmd-choose-tree.c
+++ b/cmd-choose-tree.c
@@ -39,8 +39,8 @@ void  cmd_choose_tree_free(struct window_choose_data *);
 
 const struct cmd_entry cmd_choose_tree_entry = {
        "choose-tree", NULL,
-       "S:W:swb:c:t:", 0, 1,
-       "[-sw] [-b session-template] [-c window template] [-S format] " \
+       "S:W:swub:c:t:", 0, 1,
+       "[-swu] [-b session-template] [-c window template] [-S format] " \
        "[-W format] " CMD_TARGET_WINDOW_USAGE,
        0,
        NULL,
@@ -232,6 +232,9 @@ windows_only:
        window_choose_ready(wl->window->active, cur_win,
                cmd_choose_tree_callback, cmd_choose_tree_free);
 
+       if (args_has(args, 'u'))
+               window_choose_expand_all(wl->window->active);
+
        return (CMD_RETURN_NORMAL);
 }
 


-----------------------------------------------------------------------

Summary of changes:
 cmd-choose-tree.c   |    7 +++++--
 cmd-select-window.c |   16 +++++++++++++---
 cmd.c               |    4 ++++
 tmux.1              |   19 ++++++++++++++++---
 tmux.h              |    1 +
 window-choose.c     |    2 --
 6 files changed, 39 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
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-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to