aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-16 15:54:20 +0000
committernicm <nicm>2020-05-16 15:54:20 +0000
commit472d77fd0f4af8431267473df3cf109030760fa1 (patch)
tree530d3b42bf1409311fe085b3d9904108189a328f /status.c
parent6ea6d46d0a1b206ece54a05af4f3fe7a3d6fe4cc (diff)
downloadrtmux-472d77fd0f4af8431267473df3cf109030760fa1.tar.gz
rtmux-472d77fd0f4af8431267473df3cf109030760fa1.tar.bz2
rtmux-472d77fd0f4af8431267473df3cf109030760fa1.zip
Support embedded styles in the display-message message, GitHub issue
2206.
Diffstat (limited to 'status.c')
-rw-r--r--status.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/status.c b/status.c
index 375cad4d..b5fa0824 100644
--- a/status.c
+++ b/status.c
@@ -423,7 +423,7 @@ status_redraw(struct client *c)
/* Set a status line message. */
void
-status_message_set(struct client *c, const char *fmt, ...)
+status_message_set(struct client *c, int ignore_styles, const char *fmt, ...)
{
struct timeval tv;
va_list ap;
@@ -433,6 +433,7 @@ status_message_set(struct client *c, const char *fmt, ...)
status_push_screen(c);
va_start(ap, fmt);
+ c->message_ignore_styles = ignore_styles;
xvasprintf(&c->message_string, fmt, ap);
va_end(ap);
@@ -515,7 +516,10 @@ status_message_redraw(struct client *c)
for (offset = 0; offset < c->tty.sx; offset++)
screen_write_putc(&ctx, &gc, ' ');
screen_write_cursormove(&ctx, 0, lines - 1, 0);
- screen_write_nputs(&ctx, len, &gc, "%s", c->message_string);
+ if (c->message_ignore_styles)
+ screen_write_nputs(&ctx, len, &gc, "%s", c->message_string);
+ else
+ format_draw(&ctx, &gc, c->tty.sx, c->message_string, NULL);
screen_write_stop(&ctx);
if (grid_compare(sl->active->grid, old_screen.grid) == 0) {