mirror of
https://github.com/tmux/tmux.git
synced 2026-10-16 16:44:30 +00:00
Add a vertical (side) status line, GitHub issue 5468 from John DeWyze.
This commit is contained in:
25
style.c
25
style.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: style.c,v 1.47 2026/06/29 17:08:52 nicm Exp $ */
|
||||
/* $OpenBSD: style.c,v 1.48 2026/10/16 07:59:06 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -41,10 +41,10 @@ static struct style style_default = {
|
||||
STYLE_RANGE_NONE, 0, "",
|
||||
|
||||
STYLE_WIDTH_DEFAULT, 0, STYLE_PAD_DEFAULT,
|
||||
0,
|
||||
0,
|
||||
|
||||
STYLE_DEFAULT_BASE,
|
||||
|
||||
0
|
||||
STYLE_DEFAULT_BASE
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -110,6 +110,8 @@ style_parse(struct style *sy, const struct grid_cell *base, const char *in)
|
||||
sy->default_type = STYLE_DEFAULT_POP;
|
||||
else if (strcasecmp(tmp, "set-default") == 0)
|
||||
sy->default_type = STYLE_DEFAULT_SET;
|
||||
else if (strcasecmp(tmp, "nl") == 0)
|
||||
sy->nl = 1;
|
||||
else if (strcasecmp(tmp, "nolist") == 0)
|
||||
sy->list = STYLE_LIST_OFF;
|
||||
else if (strncasecmp(tmp, "list=", 5) == 0) {
|
||||
@@ -577,3 +579,18 @@ style_ranges_get_range(struct style_ranges *srs, u_int x)
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Get range for position and row from style ranges. */
|
||||
struct style_range *
|
||||
style_ranges_get_range_at(struct style_ranges *srs, u_int x, u_int y)
|
||||
{
|
||||
struct style_range *sr;
|
||||
|
||||
if (srs == NULL)
|
||||
return (NULL);
|
||||
TAILQ_FOREACH(sr, srs, entry) {
|
||||
if (x >= sr->start && x < sr->end && y == sr->y)
|
||||
return (sr);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user