diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-21 13:17:36 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-21 13:17:36 +0200 |
commit | 6f166676c7cbd9fd572ffa2938f3737436a10f42 (patch) | |
tree | d459217d1ae4e30a3adff2ded29e24d0201b22a5 /src/interface-curses/curses-info-popup.c | |
parent | 49e1f099fd4efe78365f0449522b99bdaa661f8f (diff) | |
download | sciteco-6f166676c7cbd9fd572ffa2938f3737436a10f42.tar.gz |
PDCurses/WinGUI: fixed Unicode icons on win32
* Turns out that "%C" in wprintw() does not work with non-ANSI chars.
* We still don't want to introduce the Curses widechar API,
so I added teco_curses_add_wc() as a replacement for wadd_wch().
Diffstat (limited to 'src/interface-curses/curses-info-popup.c')
-rw-r--r-- | src/interface-curses/curses-info-popup.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/interface-curses/curses-info-popup.c b/src/interface-curses/curses-info-popup.c index 24dee41..e6e1549 100644 --- a/src/interface-curses/curses-info-popup.c +++ b/src/interface-curses/curses-info-popup.c @@ -118,14 +118,18 @@ teco_curses_info_popup_init_pad(teco_curses_info_popup_t *ctx, attr_t attr) switch (entry->type) { case TECO_POPUP_FILE: g_assert(!teco_string_contains(&entry->name, '\0')); - if (teco_ed & TECO_ED_ICONS) - wprintw(ctx->pad, "%C ", teco_curses_icons_lookup_file(entry->name.data)); + if (teco_ed & TECO_ED_ICONS) { + teco_curses_add_wc(ctx->pad, teco_curses_icons_lookup_file(entry->name.data)); + waddch(ctx->pad, ' '); + } teco_curses_format_filename(ctx->pad, entry->name.data, -1); break; case TECO_POPUP_DIRECTORY: g_assert(!teco_string_contains(&entry->name, '\0')); - if (teco_ed & TECO_ED_ICONS) - wprintw(ctx->pad, "%C ", teco_curses_icons_lookup_dir(entry->name.data)); + if (teco_ed & TECO_ED_ICONS) { + teco_curses_add_wc(ctx->pad, teco_curses_icons_lookup_dir(entry->name.data)); + waddch(ctx->pad, ' '); + } teco_curses_format_filename(ctx->pad, entry->name.data, -1); break; default: |