aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses/interface.c
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-01-30 14:22:59 +0100
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-01-30 14:36:20 +0100
commite624826447d83f1b79e5442d3695a7528cf578cf (patch)
tree9e008039f1db26974d650e26a2f099b91e690e65 /src/interface-curses/interface.c
parent7fa9feae452ea05a083b17d3f0cdf69bf5d37822 (diff)
fixup: high-color-pair support was still broken in Scintermmaster-fmsbw-ci
* Also updated A_XXX attributes to WA_XXX, where the "new" wattr_set() APIs are used. This doesn't make a difference on ncurses and PDCurses, but the X/Open standard demands it. * Allow color pairs up to 32767 instead of only up to 32766. * We now always require Curses wide-character APIs due to Scinterm, which has to use mvwin_wch(). We were practically depending on wide-character support anyway, so this shouldn't really restrict portability. * teco_curses_add_wc() has been simplified, now that we can rely on wide-char APIs. Perhaps it should be removed altogether?
Diffstat (limited to 'src/interface-curses/interface.c')
-rw-r--r--src/interface-curses/interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c
index 4f00bcf..6863a3b 100644
--- a/src/interface-curses/interface.c
+++ b/src/interface-curses/interface.c
@@ -244,7 +244,7 @@ static struct {
static gshort
teco_color_pair(attr_t *attr, gshort fg, gshort bg)
{
- static gshort next_pair = 1;
+ static guint next_pair = 1;
/*
* Basic support for monochrome terminals:
@@ -255,7 +255,7 @@ teco_color_pair(attr_t *attr, gshort fg, gshort bg)
*/
if (!has_colors()) {
if (bg != COLOR_BLACK)
- *attr |= A_REVERSE;
+ *attr |= WA_REVERSE;
return 0;
}
@@ -264,7 +264,7 @@ teco_color_pair(attr_t *attr, gshort fg, gshort bg)
gpointer value = g_hash_table_lookup(teco_interface.pair_table, key);
if (G_LIKELY(value != NULL))
return GPOINTER_TO_UINT(value);
- if (G_UNLIKELY(next_pair >= MIN(COLOR_PAIRS, G_MAXSHORT)))
+ if (G_UNLIKELY(next_pair >= MIN(COLOR_PAIRS, G_MAXSHORT+1)))
return 0;
init_pair(next_pair, fg, bg);
g_hash_table_insert(teco_interface.pair_table, key, GUINT_TO_POINTER(next_pair));
@@ -443,7 +443,7 @@ teco_interface_init(gint argc, gchar **argv)
teco_cmdline_init();
/*
* The default INDIC_STRIKE wouldn't be visible.
- * Instead we use INDIC_SQUIGGLE, which is rendered as A_UNDERLINE.
+ * Instead we use INDIC_SQUIGGLE, which is rendered as WA_UNDERLINE.
*/
teco_cmdline_ssm(SCI_INDICSETSTYLE, INDICATOR_RUBBEDOUT, INDIC_SQUIGGLE);
/*