From f01b7191a328193646885f2bb5f7ce50625385b1 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 24 Aug 2011 10:29:57 +0000 Subject: [PATCH] Add pane-base-index option, from Ben Barbour. --- options-table.c | 7 +++++++ tmux.1 | 5 +++++ window.c | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/options-table.c b/options-table.c index ed06dd54..352cdc18 100644 --- a/options-table.c +++ b/options-table.c @@ -523,6 +523,13 @@ const struct options_table_entry window_options_table[] = { .default_num = 0 }, + { .name = "pane-base-index", + .type = OPTIONS_TABLE_NUMBER, + .minimum = 0, + .maximum = USHRT_MAX, + .default_num = 0 + }, + { .name = "remain-on-exit", .type = OPTIONS_TABLE_FLAG, .default_num = 0 diff --git a/tmux.1 b/tmux.1 index 8b7639ae..b86612c5 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2418,6 +2418,11 @@ but set the width of other panes in the .Ic main-vertical layout. .Pp +.It Ic pane-base-index Ar index +Like +.Ic base-index , +but set the starting index for pane numbers. +.Pp .It Xo Ic remain-on-exit .Op Ic on | off .Xc diff --git a/window.c b/window.c index ab3177e6..0736daeb 100644 --- a/window.c +++ b/window.c @@ -454,7 +454,7 @@ window_pane_at_index(struct window *w, u_int idx) struct window_pane *wp; u_int n; - n = 0; + n = options_get_number(&w->options, "pane-base-index"); TAILQ_FOREACH(wp, &w->panes, entry) { if (n == idx) return (wp); @@ -492,7 +492,7 @@ window_pane_index(struct window *w, struct window_pane *wp) struct window_pane *wq; u_int n; - n = 0; + n = options_get_number(&w->options, "pane-base-index"); TAILQ_FOREACH(wq, &w->panes, entry) { if (wp == wq) break;