version 1.15, 2010/01/03 12:51:05 |
version 1.16, 2010/02/04 18:20:16 |
|
|
{ |
{ |
struct tty *tty = &c->tty; |
struct tty *tty = &c->tty; |
struct session *s = c->session; |
struct session *s = c->session; |
|
struct options *oo = &s->options; |
|
struct window *w = wp->window; |
struct grid_cell gc; |
struct grid_cell gc; |
u_int idx, px, py, i, j, xoff, yoff; |
u_int idx, px, py, i, j, xoff, yoff; |
int colour; |
int colour, active_colour; |
char buf[16], *ptr; |
char buf[16], *ptr; |
size_t len; |
size_t len; |
|
|
idx = window_pane_index(wp->window, wp); |
idx = window_pane_index(w, wp); |
len = xsnprintf(buf, sizeof buf, "%u", idx); |
len = xsnprintf(buf, sizeof buf, "%u", idx); |
|
|
if (wp->sx < len) |
if (wp->sx < len) |
return; |
return; |
colour = options_get_number(&s->options, "display-panes-colour"); |
colour = options_get_number(oo, "display-panes-colour"); |
|
active_colour = options_get_number(oo, "display-panes-active-colour"); |
|
|
px = wp->sx / 2; py = wp->sy / 2; |
px = wp->sx / 2; py = wp->sy / 2; |
xoff = wp->xoff; yoff = wp->yoff; |
xoff = wp->xoff; yoff = wp->yoff; |
|
|
tty_cursor(tty, xoff + px - len / 2, yoff + py); |
tty_cursor(tty, xoff + px - len / 2, yoff + py); |
memcpy(&gc, &grid_default_cell, sizeof gc); |
memcpy(&gc, &grid_default_cell, sizeof gc); |
gc.data = '_'; /* not space */ |
gc.data = '_'; /* not space */ |
colour_set_fg(&gc, colour); |
if (w->active == wp) |
|
colour_set_fg(&gc, active_colour); |
|
else |
|
colour_set_fg(&gc, colour); |
tty_attributes(tty, &gc); |
tty_attributes(tty, &gc); |
tty_puts(tty, buf); |
tty_puts(tty, buf); |
return; |
return; |
|
|
|
|
memcpy(&gc, &grid_default_cell, sizeof gc); |
memcpy(&gc, &grid_default_cell, sizeof gc); |
gc.data = '_'; /* not space */ |
gc.data = '_'; /* not space */ |
colour_set_bg(&gc, colour); |
if (w->active == wp) |
|
colour_set_bg(&gc, active_colour); |
|
else |
|
colour_set_bg(&gc, colour); |
tty_attributes(tty, &gc); |
tty_attributes(tty, &gc); |
for (ptr = buf; *ptr != '\0'; ptr++) { |
for (ptr = buf; *ptr != '\0'; ptr++) { |
if (*ptr < '0' || *ptr > '9') |
if (*ptr < '0' || *ptr > '9') |