diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-08-24 10:29:58 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-08-24 10:29:58 +0000 |
commit | 6290d9c8cfb929571530d4febe1af6f51d37c9c5 (patch) | |
tree | 04def22bfb47421b8c638b8c6f9135d5f27fec45 /usr.bin/tmux | |
parent | cfd4d1afc68dfff5833c0873ddc88a0cef978fca (diff) |
Add pane-base-index option, from Ben Barbour.
Diffstat (limited to 'usr.bin/tmux')
-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; |