Make window options work the same was as session options, add mode-fg/mode-bg options, force -g for global on set/show/setw/showw/

This commit is contained in:
Nicholas Marriott
2008-12-08 16:19:51 +00:00
parent f008d303e7
commit 7a82e86827
27 changed files with 690 additions and 768 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: window-scroll.c,v 1.24 2008-09-25 20:08:57 nicm Exp $ */
/* $Id: window-scroll.c,v 1.25 2008-12-08 16:19:51 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -101,13 +101,13 @@ window_scroll_resize(struct window *w, u_int sx, u_int sy)
}
void
window_scroll_key(struct window *w, struct client *c, int key)
window_scroll_key(struct window *w, unused struct client *c, int key)
{
struct window_scroll_mode_data *data = w->modedata;
struct screen *s = &data->screen;
int table;
table = options_get_number(&c->session->options, "mode-keys");
table = options_get_number(&w->options, "mode-keys");
switch (mode_key_lookup(table, key)) {
case MODEKEY_QUIT:
window_reset_mode(w);
@@ -157,10 +157,11 @@ window_scroll_write_line(
memcpy(&gc, &grid_default_cell, sizeof gc);
size = xsnprintf(hdr, sizeof hdr,
"[%u,%u/%u]", data->ox, data->oy, screen_hsize(&w->base));
gc.attr |= GRID_ATTR_BRIGHT|GRID_ATTR_REVERSE;
gc.fg = options_get_number(&w->options, "mode-fg");
gc.bg = options_get_number(&w->options, "mode-bg");
screen_write_cursormove(ctx, screen_size_x(s) - size, 0);
screen_write_puts(ctx, &gc, "%s", hdr);
gc.attr &= ~(GRID_ATTR_BRIGHT|GRID_ATTR_REVERSE);
memcpy(&gc, &grid_default_cell, sizeof gc);
} else
size = 0;