mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-11 19:59:06 +00:00
Make xterm use my_wcwidth unconditionally again.
CharWidth is a conditional wrapper that assumes that all wide characters in the range 32-126 and 160-255) are latin-1 characters and are identical with the unicode (UTF-8) codepoints and result in a width of 1. This is correct in so far that the names of these code-points are identical, but for SHY (soft-hyphen) the explanation of how it should be used differs between unicode and latin-1. Latin-1 assumes that it's always displayed, for unicode it should only be displayed after local grammar rules apply. This wrapper got introduced in xterm #334 and is on the short-list of Thomas Dickey to fix. Since we don't know when the next release is going to be, commit this one now, so we have it fixed before 7.0. Originally discrepency between xterm and wcwidth(3) pointed out by Lauri Tirkkonen (lauri <at> hacktheplanet <dot> fi). OK matthieu@
This commit is contained in:
@@ -963,7 +963,7 @@ extern void report_char_class(XtermWidget);
|
|||||||
#define WideCells(n) (((IChar)(n) >= first_widechar) ? my_wcwidth((wchar_t) (n)) : 1)
|
#define WideCells(n) (((IChar)(n) >= first_widechar) ? my_wcwidth((wchar_t) (n)) : 1)
|
||||||
#define isWideFrg(n) (((n) == HIDDEN_CHAR) || (WideCells((n)) == 2))
|
#define isWideFrg(n) (((n) == HIDDEN_CHAR) || (WideCells((n)) == 2))
|
||||||
#define isWide(n) (((IChar)(n) >= first_widechar) && isWideFrg(n))
|
#define isWide(n) (((IChar)(n) >= first_widechar) && isWideFrg(n))
|
||||||
#define CharWidth(n) (((n) < 256) ? (IsLatin1(n) ? 1 : 0) : my_wcwidth((wchar_t) (n)))
|
#define CharWidth(n) (my_wcwidth((wchar_t) (n)))
|
||||||
#else
|
#else
|
||||||
#define WideCells(n) 1
|
#define WideCells(n) 1
|
||||||
#define CharWidth(n) (IsLatin1(n) ? 1 : 0)
|
#define CharWidth(n) (IsLatin1(n) ? 1 : 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user