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.
This commit is contained in:
nicm
2019-03-18 20:53:33 +00:00
parent d738d51688
commit 979313832c
15 changed files with 1338 additions and 561 deletions

View File

@ -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 + sy - 2, 0);
screen_write_cursormove(ctx, cx, cy + at, 0);
screen_write_preview(ctx, &wp->base, sx, sy - 2 - lines);
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 *