aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2021-08-12 19:47:05 +0000
committernicm <nicm>2021-08-12 19:47:05 +0000
commit9b004728202d03241009ef5f73980909e9234bc4 (patch)
tree6492c6e6a97837a1e8cc66d910303177598850e6
parent5d451551b6457d972897fa60b3dba38e13d6589f (diff)
downloadrtmux-9b004728202d03241009ef5f73980909e9234bc4.tar.gz
rtmux-9b004728202d03241009ef5f73980909e9234bc4.tar.bz2
rtmux-9b004728202d03241009ef5f73980909e9234bc4.zip
Evaluate styles with the pane variables.
-rw-r--r--cmd-select-pane.c2
-rw-r--r--format.c9
-rw-r--r--tty.c13
3 files changed, 15 insertions, 9 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index 7871fe05..c5b4ee13 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -145,10 +145,12 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
markedwp = marked_pane.wp;
if (lastwp != NULL) {
+ lastwp->flags |= (PANE_REDRAW|PANE_STYLECHANGED);
server_redraw_window_borders(lastwp->window);
server_status_window(lastwp->window);
}
if (markedwp != NULL) {
+ markedwp->flags |= (PANE_REDRAW|PANE_STYLECHANGED);
server_redraw_window_borders(markedwp->window);
server_status_window(markedwp->window);
}
diff --git a/format.c b/format.c
index 5a295198..9ef4e6e9 100644
--- a/format.c
+++ b/format.c
@@ -4300,15 +4300,14 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen,
if (strcmp(found, condition) == 0) {
free(found);
found = xstrdup("");
- format_log(es, "condition '%s' found: %s",
- condition, found);
- } else {
format_log(es,
"condition '%s' not found; assuming false",
condition);
}
- } else
- format_log(es, "condition '%s' found", condition);
+ } else {
+ format_log(es, "condition '%s' found: %s", condition,
+ found);
+ }
if (format_choose(es, cp + 1, &left, &right, 0) != 0) {
format_log(es, "condition '%s' syntax error: %s",
diff --git a/tty.c b/tty.c
index 6cebe051..ecad9249 100644
--- a/tty.c
+++ b/tty.c
@@ -2790,18 +2790,23 @@ tty_window_default_style(struct grid_cell *gc, struct window_pane *wp)
void
tty_default_colours(struct grid_cell *gc, struct window_pane *wp)
{
- struct options *oo = wp->options;
+ struct options *oo = wp->options;
+ struct format_tree *ft;
memcpy(gc, &grid_default_cell, sizeof *gc);
if (wp->flags & PANE_STYLECHANGED) {
+ log_debug("%%%u: style changed", wp->id);
wp->flags &= ~PANE_STYLECHANGED;
+ ft = format_create(NULL, NULL, FORMAT_PANE|wp->id,
+ FORMAT_NOJOBS);
+ format_defaults(ft, NULL, NULL, NULL, wp);
tty_window_default_style(&wp->cached_active_gc, wp);
- style_add(&wp->cached_active_gc, oo, "window-active-style",
- NULL);
+ style_add(&wp->cached_active_gc, oo, "window-active-style", ft);
tty_window_default_style(&wp->cached_gc, wp);
- style_add(&wp->cached_gc, oo, "window-style", NULL);
+ style_add(&wp->cached_gc, oo, "window-style", ft);
+ format_free(ft);
}
if (gc->fg == 8) {