choose-tree, by default, folds/collapses the window tree grouped by session.
This adds an option to make it configurable.

Signed-off-by: Raghavendra D Prabhu <rpra...@wnohang.net>
---
 options-table.c | 5 +++++
 window-choose.c | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/options-table.c b/options-table.c
index c2ef30c..1fc0b00 100644
--- a/options-table.c
+++ b/options-table.c
@@ -115,6 +115,11 @@ const struct options_table_entry session_options_table[] = 
{
                         "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        },
 
+       { .name = "choose-tree-collapse",
+         .type = OPTIONS_TABLE_FLAG,
+         .default_num = 1
+       },
+
        { .name = "default-command",
          .type = OPTIONS_TABLE_STRING,
          .default_str = ""
diff --git a/window-choose.c b/window-choose.c
index 3368c66..9d6b3f8 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -107,6 +107,8 @@ window_choose_ready(struct window_pane *wp, u_int cur,
 {
        struct window_choose_mode_data  *data = wp->modedata;
        struct screen                   *s = &data->screen;
+       struct options                  *oo = &global_s_options;
+       int                             collapse = options_get_number(oo, 
"choose-tree-collapse");
 
        data->selected = cur;
        if (data->selected > screen_size_y(s) - 1)
@@ -117,7 +119,8 @@ window_choose_ready(struct window_pane *wp, u_int cur,
 
        ARRAY_CONCAT(&data->old_list, &data->list);
 
-       window_choose_collapse_all(wp);
+       if (collapse)
+               window_choose_collapse_all(wp);
        window_choose_redraw_screen(wp);
 }
 
-- 
1.8.0


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to