notcurses-info: print check/x for styles

pull/1838/head
nick black 3 years ago committed by Nick Black
parent 9ed9f6bfc0
commit c0a61357d8

@ -5,14 +5,19 @@
#include "internal.h" // internal headers #include "internal.h" // internal headers
static inline wchar_t static inline wchar_t
capbool(const tinfo* ti, bool cap){ capboolbool(unsigned utf8, bool cap){
if(ti->caps.utf8){ if(utf8){
return cap ? L'' : L''; return cap ? L'' : L'';
}else{ }else{
return cap ? '+' : '-'; return cap ? '+' : '-';
} }
} }
static inline wchar_t
capbool(const tinfo* ti, bool cap){
return capboolbool(ti->caps.utf8, cap);
}
static int static int
unicodedumper(const struct notcurses* nc, struct ncplane* n, tinfo* ti, const char* indent){ unicodedumper(const struct notcurses* nc, struct ncplane* n, tinfo* ti, const char* indent){
ncplane_printf(n, "%sutf8%lc quad%lc sex%lc braille%lc images%lc videos%lc\n", ncplane_printf(n, "%sutf8%lc quad%lc sex%lc braille%lc images%lc videos%lc\n",
@ -68,6 +73,8 @@ static void
tinfo_debug_style(struct ncplane* n, const char* name, int style){ tinfo_debug_style(struct ncplane* n, const char* name, int style){
ncplane_set_styles(n, style); ncplane_set_styles(n, style);
ncplane_putstr(n, name); ncplane_putstr(n, name);
ncplane_putwc(n, capboolbool(notcurses_canutf8(ncplane_notcurses(n)),
notcurses_supported_styles(ncplane_notcurses(n)) & style));
ncplane_set_styles(n, NCSTYLE_NONE); ncplane_set_styles(n, NCSTYLE_NONE);
} }

Loading…
Cancel
Save