wcwidth: Return 0 for median/final jamo

Fixes #5729.
This commit is contained in:
Fabian Homborg
2019-03-13 12:37:24 +01:00
parent 028112e535
commit 05b9c07816

View File

@@ -287,8 +287,10 @@ int fish_wcwidth(wchar_t wc) {
else if (wc == variation_selector_15) return 0;
// Korean Hangul Jamo median vowels and final consonants.
// These are effectively combiners, so we handle them like combiners.
if (wc >= L'\u1160' && wc <= L'\u11FF') return wcwidth(wc);
// These can either appear in combined form, taking 0 width themselves,
// or standalone with a 1 width. Since that's literally not expressible with wcwidth(),
// we take the position that the typical way for them to show up is composed.
if (wc >= L'\u1160' && wc <= L'\u11FF') return 0;
int width = widechar_wcwidth(wc);
switch (width) {
case widechar_nonprint: