Merge branch 'obsd-master' into master

This commit is contained in:
Thomas Adam 2021-08-12 22:01:22 +01:00
commit 94d96c6179
4 changed files with 17 additions and 11 deletions

View File

@ -145,10 +145,12 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
markedwp = marked_pane.wp; markedwp = marked_pane.wp;
if (lastwp != NULL) { if (lastwp != NULL) {
lastwp->flags |= (PANE_REDRAW|PANE_STYLECHANGED);
server_redraw_window_borders(lastwp->window); server_redraw_window_borders(lastwp->window);
server_status_window(lastwp->window); server_status_window(lastwp->window);
} }
if (markedwp != NULL) { if (markedwp != NULL) {
markedwp->flags |= (PANE_REDRAW|PANE_STYLECHANGED);
server_redraw_window_borders(markedwp->window); server_redraw_window_borders(markedwp->window);
server_status_window(markedwp->window); server_status_window(markedwp->window);
} }

View File

@ -4300,15 +4300,14 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen,
if (strcmp(found, condition) == 0) { if (strcmp(found, condition) == 0) {
free(found); free(found);
found = xstrdup(""); found = xstrdup("");
format_log(es, "condition '%s' found: %s",
condition, found);
} else {
format_log(es, format_log(es,
"condition '%s' not found; assuming false", "condition '%s' not found; assuming false",
condition); condition);
} }
} else } else {
format_log(es, "condition '%s' found", condition); format_log(es, "condition '%s' found: %s", condition,
found);
}
if (format_choose(es, cp + 1, &left, &right, 0) != 0) { if (format_choose(es, cp + 1, &left, &right, 0) != 0) {
format_log(es, "condition '%s' syntax error: %s", format_log(es, "condition '%s' syntax error: %s",

View File

@ -390,10 +390,10 @@ status_redraw(struct client *c)
/* Set up default colour. */ /* Set up default colour. */
style_apply(&gc, s->options, "status-style", ft); style_apply(&gc, s->options, "status-style", ft);
fg = options_get_number(s->options, "status-fg"); fg = options_get_number(s->options, "status-fg");
if (fg != 8) if (!COLOUR_DEFAULT(fg))
gc.fg = fg; gc.fg = fg;
bg = options_get_number(s->options, "status-bg"); bg = options_get_number(s->options, "status-bg");
if (bg != 8) if (!COLOUR_DEFAULT(bg))
gc.bg = bg; gc.bg = bg;
if (!grid_cells_equal(&gc, &sl->style)) { if (!grid_cells_equal(&gc, &sl->style)) {
force = 1; force = 1;

13
tty.c
View File

@ -2790,18 +2790,23 @@ tty_window_default_style(struct grid_cell *gc, struct window_pane *wp)
void void
tty_default_colours(struct grid_cell *gc, struct window_pane *wp) 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); memcpy(gc, &grid_default_cell, sizeof *gc);
if (wp->flags & PANE_STYLECHANGED) { if (wp->flags & PANE_STYLECHANGED) {
log_debug("%%%u: style changed", wp->id);
wp->flags &= ~PANE_STYLECHANGED; 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); tty_window_default_style(&wp->cached_active_gc, wp);
style_add(&wp->cached_active_gc, oo, "window-active-style", style_add(&wp->cached_active_gc, oo, "window-active-style", ft);
NULL);
tty_window_default_style(&wp->cached_gc, wp); 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) { if (gc->fg == 8) {