summaryrefslogtreecommitdiffstats
path: root/window-client.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-18 20:53:33 +0000
committernicm <nicm>2019-03-18 20:53:33 +0000
commit979313832ce1d5f6cdc2c512e8524d6c517422e0 (patch)
tree13768e951adacd7c96b493a84fb5e65838ef94ed /window-client.c
parentd738d5168804405240a3f36b6f410baee39cd9e0 (diff)
Extend the #[] style syntax and use that together with previous format
changes to allow the status line to be entirely configured with a single option. Now that it is possible to configure their content, enable the existing code that lets the status line be multiple lines in height. The status option can now take a value of 2, 3, 4 or 5 (as well as the previous on or off) to configure more than one line. The new status-format array option configures the format of each line, the default just references the existing status-* options, although some of the more obscure status options may be eliminated in time. Additions to the #[] syntax are: "align" to specify alignment (left, centre, right), "list" for the window list and "range" to configure ranges of text for the mouse bindings. The "align" keyword can also be used to specify alignment of entries in tree mode and the pane status lines.
Diffstat (limited to 'window-client.c')
-rw-r--r--window-client.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/window-client.c b/window-client.c
index ec98984d..e0637a06 100644
--- a/window-client.c
+++ b/window-client.c
@@ -217,20 +217,36 @@ window_client_draw(__unused void *modedata, void *itemdata,
{
struct window_client_itemdata *item = itemdata;
struct client *c = item->c;
+ struct screen *s = ctx->s;
struct window_pane *wp;
- u_int cx = ctx->s->cx, cy = ctx->s->cy;
+ u_int cx = s->cx, cy = s->cy, lines, at;
if (c->session == NULL || (c->flags & (CLIENT_DEAD|CLIENT_DETACHING)))
return;
wp = c->session->curw->window->active;
- screen_write_preview(ctx, &wp->base, sx, sy - 3);
+ lines = status_line_size(c);
+ if (lines >= sy)
+ lines = 0;
+ if (status_at_line(c) == 0)
+ at = lines;
+ else
+ at = 0;
+
+ screen_write_cursormove(ctx, cx, cy + at, 0);
+ screen_write_preview(ctx, &wp->base, sx, sy - 2 - lines);
- screen_write_cursormove(ctx, cx, cy + sy - 2, 0);
+ if (at != 0)
+ screen_write_cursormove(ctx, cx, cy + 2, 0);
+ else
+ screen_write_cursormove(ctx, cx, cy + sy - 1 - lines, 0);
screen_write_hline(ctx, sx, 0, 0);
- screen_write_cursormove(ctx, cx, cy + sy - 1, 0);
- screen_write_fast_copy(ctx, &c->status.screen, 0, 0, sx, 1);
+ if (at != 0)
+ screen_write_cursormove(ctx, cx, cy, 0);
+ else
+ screen_write_cursormove(ctx, cx, cy + sy - lines, 0);
+ screen_write_fast_copy(ctx, &c->status.screen, 0, 0, sx, lines);
}
static struct screen *