aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses/curses-utils.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/curses-utils.c
parent7fa9feae452ea05a083b17d3f0cdf69bf5d37822 (diff)
fixup: high-color-pair support was still broken in ScintermHEADmaster-fmsbw-cimaster
* 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/curses-utils.c')
-rw-r--r--src/interface-curses/curses-utils.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/interface-curses/curses-utils.c b/src/interface-curses/curses-utils.c
index 875c332..3b25d56 100644
--- a/src/interface-curses/curses-utils.c
+++ b/src/interface-curses/curses-utils.c
@@ -53,9 +53,9 @@ teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width)
/*
* The entire background might be in reverse, especially
* on monochrome terminals.
- * In those cases, we have to __remove__ the A_REVERSE flag.
+ * In those cases, we have to __remove__ the WA_REVERSE flag.
*/
- attr_t attrs = A_NORMAL;
+ attr_t attrs = WA_NORMAL;
short pair = 0;
wattr_get(win, &attrs, &pair, NULL);
@@ -81,28 +81,28 @@ teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width)
chars_added++;
if (chars_added > max_width)
goto truncate;
- wattr_set(win, attrs ^ A_REVERSE, pair, NULL);
+ wattr_set(win, attrs ^ WA_REVERSE, pair, NULL);
waddch(win, '$');
break;
case '\r':
chars_added += 2;
if (chars_added > max_width)
goto truncate;
- wattr_set(win, attrs ^ A_REVERSE, pair, NULL);
+ wattr_set(win, attrs ^ WA_REVERSE, pair, NULL);
waddstr(win, "CR");
break;
case '\n':
chars_added += 2;
if (chars_added > max_width)
goto truncate;
- wattr_set(win, attrs ^ A_REVERSE, pair, NULL);
+ wattr_set(win, attrs ^ WA_REVERSE, pair, NULL);
waddstr(win, "LF");
break;
case '\t':
chars_added += 3;
if (chars_added > max_width)
goto truncate;
- wattr_set(win, attrs ^ A_REVERSE, pair, NULL);
+ wattr_set(win, attrs ^ WA_REVERSE, pair, NULL);
waddstr(win, "TAB");
break;
default:
@@ -110,7 +110,7 @@ teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width)
chars_added += 2;
if (chars_added > max_width)
goto truncate;
- wattr_set(win, attrs ^ A_REVERSE, pair, NULL);
+ wattr_set(win, attrs ^ WA_REVERSE, pair, NULL);
waddch(win, '^');
waddch(win, TECO_CTL_ECHO(*str));
} else {
@@ -126,7 +126,7 @@ teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width)
waddnstr(win, str, clen);
}
}
- /* restore original state of A_REVERSE */
+ /* restore original state of WA_REVERSE */
wattr_set(win, attrs, pair, NULL);
str += clen;