curses run-time options

This started out as an attempt to document the curses options in the
Guidebook, but I didn't actually get that far.  Instead, integrate
the curses options better via more consistent WC/WC2 usage.  This
prevents 'guicolor' from showing up as a boolean option for non-curses
interface in curses+other binary.

For curses itself, let 'petattr' be set/reset via 'O'.  Also, accept
'Dim' as a possible pet highlight attribute since it already handles
all the other ordinary attributes.  I'm not sure what leftline and
rightline highlighting are supposed to do.  They were missing for
ncurses (or maybe they're misspelled for PDcurses?) but adding them
didn't produce any visible effect (using TERM=xterm-256color on OSX
with default font/character set).

Not addressed:
1) general confusion about compile-time vs run-time option filtering;
2) curses pet highlighting only works if 'color' option is enabled.
This commit is contained in:
PatR
2019-02-26 15:16:42 -08:00
parent 5a432d0c97
commit 1a028d1197
5 changed files with 178 additions and 89 deletions
+8 -4
View File
@@ -835,11 +835,15 @@ curses_init_options()
iflags.wc2_windowborders = 3; /* Set to auto if not specified */
}
if (!iflags.wc2_petattr) {
iflags.wc2_petattr = A_REVERSE;
} else { /* Pet attribute specified, so hilite_pet should be true */
/* fix up pet highlighting */
if (iflags.wc2_petattr == -1) /* shouldn't happen */
iflags.wc2_petattr = A_NORMAL;
if (iflags.wc2_petattr != A_NORMAL) {
/* Pet attribute specified, so hilite_pet should be true */
iflags.hilite_pet = TRUE;
} else if (iflags.hilite_pet) {
/* pet highlighting specified, so don't leave petattr at A_NORMAL */
iflags.wc2_petattr = A_REVERSE;
}
#ifdef NCURSES_MOUSE_VERSION