=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.30 retrieving revision 1.31 diff -c -r1.30 -r1.31 *** src/usr.bin/tmux/status.c 2009/09/02 06:33:20 1.30 --- src/usr.bin/tmux/status.c 2009/09/07 10:49:32 1.31 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.30 2009/09/02 06:33:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.31 2009/09/07 10:49:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 107,120 **** left = status_replace(s, options_get_string( &s->options, "status-left"), c->status_timer.tv_sec); llen = options_get_number(&s->options, "status-left-length"); ! llen2 = screen_write_strlen(utf8flag, "%s", left); if (llen2 < llen) llen = llen2; right = status_replace(s, options_get_string( &s->options, "status-right"), c->status_timer.tv_sec); rlen = options_get_number(&s->options, "status-right-length"); ! rlen2 = screen_write_strlen(utf8flag, "%s", right); if (rlen2 < rlen) rlen = rlen2; --- 107,120 ---- left = status_replace(s, options_get_string( &s->options, "status-left"), c->status_timer.tv_sec); llen = options_get_number(&s->options, "status-left-length"); ! llen2 = screen_write_cstrlen(utf8flag, "%s", left); if (llen2 < llen) llen = llen2; right = status_replace(s, options_get_string( &s->options, "status-right"), c->status_timer.tv_sec); rlen = options_get_number(&s->options, "status-right-length"); ! rlen2 = screen_write_cstrlen(utf8flag, "%s", right); if (rlen2 < rlen) rlen = rlen2; *************** *** 192,198 **** screen_write_start(&ctx, NULL, &c->status); if (llen != 0) { screen_write_cursormove(&ctx, 0, yy); ! screen_write_nputs(&ctx, llen, &sl_stdgc, utf8flag, "%s", left); screen_write_putc(&ctx, &stdgc, ' '); if (larrow) screen_write_putc(&ctx, &stdgc, ' '); --- 192,198 ---- screen_write_start(&ctx, NULL, &c->status); if (llen != 0) { screen_write_cursormove(&ctx, 0, yy); ! screen_write_cnputs(&ctx, llen, &sl_stdgc, utf8flag, "%s", left); screen_write_putc(&ctx, &stdgc, ' '); if (larrow) screen_write_putc(&ctx, &stdgc, ' '); *************** *** 266,272 **** if (rlen != 0) { screen_write_cursormove(&ctx, c->tty.sx - rlen - 1, yy); screen_write_putc(&ctx, &stdgc, ' '); ! screen_write_nputs(&ctx, rlen, &sr_stdgc, utf8flag, "%s", right); } /* Draw the arrows. */ --- 266,272 ---- if (rlen != 0) { screen_write_cursormove(&ctx, c->tty.sx - rlen - 1, yy); screen_write_putc(&ctx, &stdgc, ' '); ! screen_write_cnputs(&ctx, rlen, &sr_stdgc, utf8flag, "%s", right); } /* Draw the arrows. */ *************** *** 398,403 **** --- 398,417 ---- while (len > 0 && *ptr != '\0') { *optr++ = *ptr++; len--; + } + break; + case '[': + /* + * Embedded style, handled at display time. + * Leave present and skip input until ]. + */ + *optr++ = '#'; + + iptr--; /* include [ */ + while (*iptr != ']' && *iptr != '\0') { + if (optr >= out + (sizeof out) - 1) + break; + *optr++ = *iptr++; } break; case '#':