diff --git a/src/fallback.cpp b/src/fallback.cpp index c93d685be..d5104daab 100644 --- a/src/fallback.cpp +++ b/src/fallback.cpp @@ -243,12 +243,6 @@ int fish_wcwidth(wchar_t wc) { else if (wc == variation_selector_15) return 0; - // Korean Hangul Jamo median vowels and final consonants. - // 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; - // Check for Emoji_Modifier property. Only the Fitzpatrick modifiers have this, in range // 1F3FB..1F3FF. This is a hack because such an emoji appearing on its own would be drawn as // width 2, but that's unlikely to be useful. See #8275. diff --git a/src/widecharwidth/widechar_width.h b/src/widecharwidth/widechar_width.h index 0843f7b6c..cc849745a 100644 --- a/src/widecharwidth/widechar_width.h +++ b/src/widecharwidth/widechar_width.h @@ -1,5 +1,5 @@ /** - * widechar_width.h, generated on 2021-10-26. + * widechar_width.h, generated on 2022-01-01. * See https://github.com/ridiculousfish/widecharwidth/ * * SHA1 file hashes: @@ -378,6 +378,12 @@ static const struct widechar_range widechar_combining_table[] = { {0xE0100, 0xE01EF} }; +/* Width 0 combining letters. */ +static const struct widechar_range widechar_combiningletters_table[] = { + {0x01160, 0x011FF}, + {0x0D7B0, 0x0D7FF} +}; + /* Width 2 characters. */ static const struct widechar_range widechar_doublewide_table[] = { {0x01100, 0x0115F}, @@ -1463,6 +1469,8 @@ int widechar_wcwidth(uint32_t c) { return widechar_non_character; if (widechar_in_table(widechar_combining_table, c)) return widechar_combining; + if (widechar_in_table(widechar_combiningletters_table, c)) + return widechar_combining; if (widechar_in_table(widechar_doublewide_table, c)) return 2; if (widechar_in_table(widechar_ambiguous_table, c))