Changeset 9efa5bd for functions.c


Ignore:
Timestamp:
May 1, 2011, 5:29:25 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
7b4f3be
Parents:
4fd211f
git-author:
David Benjamin <davidben@mit.edu> (04/26/11 21:07:08)
git-committer:
David Benjamin <davidben@mit.edu> (05/01/11 17:29:25)
Message:
Clamp the number of color pairs to 256 without ext-color

Debian doesn't build their ncurses with ext-color support, so it only
supports 256 colorpairs. However, ncurses still reports the full 32768
value, and color pairs end up trampling over each other.

When 256 is exceeded, the existing colorpair reset logic will now kick
in and fix things. Reword a comment accordingly.

While I'm here, get rid of the colorpairs member in owl_global. ncurses'
works just fine.

Reported-by: Mats Ahlgren <mats_a@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r4fd211f r9efa5bd  
    18191819  if (owl_global_get_hascolors(&g)) {
    18201820    owl_fmtext_append_normal(&fm, "Color: Yes\n");
    1821     owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_global_get_colorpairs(&g));
     1821    owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_util_get_colorpairs());
    18221822    owl_fmtext_appendf_normal(&fm, "Can change colors: %s\n", can_change_color() ? "yes" : "no");
    18231823  } else {
Note: See TracChangeset for help on using the changeset viewer.