summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-05-18 21:55:53 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-05-18 21:55:53 +0000
commit6e4b947d71dfc666a9df10546191133c75afbe18 (patch)
treedff3f35f58ff57bd2a58f1e859b9cbaec096f55f /layout.c
parent3ee4b334e7b2456da5daf41a3bc2b95845765711 (diff)
New option main-pane-width to set width of pane in left-vertical mode.
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/layout.c b/layout.c
index 3b394e94..a01c0d09 100644
--- a/layout.c
+++ b/layout.c
@@ -1,4 +1,4 @@
-/* $Id: layout.c,v 1.11 2009-05-18 21:29:11 nicm Exp $ */
+/* $Id: layout.c,v 1.12 2009-05-18 21:55:53 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -234,7 +234,7 @@ void
layout_left_v_refresh(struct window *w, int active_only)
{
struct window_pane *wp;
- u_int i, n, height, yoff;
+ u_int i, n, mainwidth, height, yoff;
if (active_only)
return;
@@ -244,8 +244,11 @@ layout_left_v_refresh(struct window *w, int active_only)
if (n == 0)
return;
+ /* Get the main pane width and add one for separator line. */
+ mainwidth = options_get_number(&w->options, "main-pane-width") + 1;
+
/* Need >1 pane and minimum columns; if fewer, display active only. */
- if (n == 1 || w->sx < 82 + PANE_MINIMUM) {
+ if (n == 1 || w->sx < mainwidth + PANE_MINIMUM) {
layout_active_only_refresh(w, active_only);
return;
}
@@ -264,7 +267,7 @@ layout_left_v_refresh(struct window *w, int active_only)
if (wp == TAILQ_FIRST(&w->panes)) {
wp->xoff = 0;
wp->yoff = 0;
- window_pane_resize(wp, 81, w->sy);
+ window_pane_resize(wp, mainwidth - 1, w->sy);
wp->flags &= ~PANE_HIDDEN;
continue;
}
@@ -275,12 +278,12 @@ layout_left_v_refresh(struct window *w, int active_only)
}
wp->flags &= ~PANE_HIDDEN;
- wp->xoff = 82;
+ wp->xoff = mainwidth;
wp->yoff = yoff;
if (i != n - 1)
- window_pane_resize(wp, w->sx - 82, height - 1);
+ window_pane_resize(wp, w->sx - mainwidth, height - 1);
else
- window_pane_resize(wp, w->sx - 82, height);
+ window_pane_resize(wp, w->sx - mainwidth, height);
i++;
yoff += height;