From 4332f8a249669b2cf484e905c640e52b8ad2f3c3 Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Mon, 23 Jan 2023 15:43:36 +0800 Subject: [PATCH] notcurses-input: also show effective text if different from ID/utf8 --- src/input/input.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/input/input.cpp b/src/input/input.cpp index 821f7a8f7..9f7395251 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -361,6 +361,16 @@ int input_demo(ncpp::NotCurses* nc) { n->printf("Unicode: [0x%08x] '%s'", r, ni.utf8); } } + if(ni.eff_text[0] != ni.id || ni.eff_text[1] != 0){ + n->printf(" effective text '"); + for (int c=0; ni.eff_text[c]!=0; c++){ + unsigned char egc[5]={0}; + if(notcurses_ucs32_to_utf8(&ni.eff_text[c], 1, egc, 4)>=0){ + n->printf("%s", egc); + } + } + n->printf("'"); + } unsigned x; n->get_cursor_yx(nullptr, &x); for(unsigned i = x ; i < n->get_dim_x() ; ++i){