diff options
-rw-r--r-- | usr.bin/tmux/options-table.c | 9 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 9 | ||||
-rw-r--r-- | usr.bin/tmux/window.c | 6 |
3 files changed, 18 insertions, 6 deletions
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c index 80b107b2592..62a97638b50 100644 --- a/usr.bin/tmux/options-table.c +++ b/usr.bin/tmux/options-table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options-table.c,v 1.12 2011/07/30 18:01:26 nicm Exp $ */ +/* $OpenBSD: options-table.c,v 1.13 2011/08/24 10:29:57 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 008eebd56e8..284fb9cbd68 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.242 2011/08/16 10:00:52 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.243 2011/08/24 10:29:57 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 16 2011 $ +.Dd $Mdocdate: August 24 2011 $ .Dt TMUX 1 .Os .Sh NAME @@ -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/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 37941497044..cc878b60cd0 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.66 2011/06/05 10:53:05 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.67 2011/08/24 10:29:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |