From e624826447d83f1b79e5442d3695a7528cf578cf Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 30 Jan 2026 14:22:59 +0100 Subject: fixup: high-color-pair support was still broken in Scinterm * 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? --- src/interface-curses/curses-utils.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/interface-curses/curses-utils.h') diff --git a/src/interface-curses/curses-utils.h b/src/interface-curses/curses-utils.h index 97fc1cc..c6d9d8d 100644 --- a/src/interface-curses/curses-utils.h +++ b/src/interface-curses/curses-utils.h @@ -27,15 +27,12 @@ guint teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_ guint teco_curses_format_filename(WINDOW *win, const gchar *filename, gint max_width); -/** - * Add Unicode character to window. - * This is just like wadd_wch(), but does not require wide-char APIs. - */ +/** Add Unicode character to window. */ static inline void teco_curses_add_wc(WINDOW *win, gunichar chr) { - gchar buf[6]; - waddnstr(win, buf, g_unichar_to_utf8(chr, buf)); + wchar_t wc = chr; + waddnwstr(win, &wc, 1); } /** -- cgit v1.2.3