Add a minor optimisatin: if the character being printed is space, don't worry

about setting the background colour or attributes (except reverse).
This commit is contained in:
Nicholas Marriott
2009-10-28 08:52:36 +00:00
parent 5730cbf3e3
commit 1eaefbf169
2 changed files with 18 additions and 2 deletions

View File

@ -257,6 +257,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
if (wp->sx < len * 6 || wp->sy < 5) {
tty_cursor(tty, xoff + px - len / 2, yoff + py);
memcpy(&gc, &grid_default_cell, sizeof gc);
gc.data = '_'; /* not space */
colour_set_fg(&gc, colour);
tty_attributes(tty, &gc);
tty_puts(tty, buf);
@ -267,6 +268,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
py -= 2;
memcpy(&gc, &grid_default_cell, sizeof gc);
gc.data = '_'; /* not space */
colour_set_bg(&gc, colour);
tty_attributes(tty, &gc);
for (ptr = buf; *ptr != '\0'; ptr++) {