mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-05 00:54:26 +03:00
minibar: when the next character has zero width, show its code too
This allows seeing that an accented character is not a single code point but composed from a base character plus a combining character.
This commit is contained in:
parent
24e5f956d0
commit
41fd09706d
14
src/winio.c
14
src/winio.c
@ -2072,6 +2072,7 @@ void minibar(void)
|
|||||||
char *thename = NULL, *number_of_lines = NULL, *ranking = NULL;
|
char *thename = NULL, *number_of_lines = NULL, *ranking = NULL;
|
||||||
char *location = nmalloc(44);
|
char *location = nmalloc(44);
|
||||||
char *hexadecimal = nmalloc(9);
|
char *hexadecimal = nmalloc(9);
|
||||||
|
char *successor = NULL;
|
||||||
size_t namewidth, placewidth;
|
size_t namewidth, placewidth;
|
||||||
size_t tallywidth = 0;
|
size_t tallywidth = 0;
|
||||||
size_t padding = 2;
|
size_t padding = 2;
|
||||||
@ -2157,10 +2158,21 @@ void minibar(void)
|
|||||||
sprintf(hexadecimal, " 0x%02X", (unsigned char)*this_position);
|
sprintf(hexadecimal, " 0x%02X", (unsigned char)*this_position);
|
||||||
|
|
||||||
mvwaddstr(bottomwin, 0, COLS - 23, hexadecimal);
|
mvwaddstr(bottomwin, 0, COLS - 23, hexadecimal);
|
||||||
|
|
||||||
|
#ifdef ENABLE_UTF8
|
||||||
|
successor = this_position + char_length(this_position);
|
||||||
|
|
||||||
|
if (*this_position != '\0' && is_zerowidth(successor) &&
|
||||||
|
mbtowc(&widecode, successor, MAXCHARLEN) >= 0) {
|
||||||
|
sprintf(hexadecimal, "|%04X", (int)widecode);
|
||||||
|
waddstr(bottomwin, hexadecimal);
|
||||||
|
} else
|
||||||
|
successor = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the state of three flags, and the state of macro and mark. */
|
/* Display the state of three flags, and the state of macro and mark. */
|
||||||
if (namewidth + tallywidth + 14 + 2 * padding < COLS) {
|
if (!successor && namewidth + tallywidth + 14 + 2 * padding < COLS) {
|
||||||
wmove(bottomwin, 0, COLS - 11 - padding);
|
wmove(bottomwin, 0, COLS - 11 - padding);
|
||||||
show_states_at(bottomwin);
|
show_states_at(bottomwin);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user