mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-17 17:32:45 +08:00
Don't increase the width for variation selector 15.
See discussion in #5668 and #5583
This commit is contained in:
parent
8a93c7d0ea
commit
6aa2f29901
|
@ -282,8 +282,10 @@ int fish_wcswidth(const wchar_t *str, size_t n) { return wcswidth(str, n); }
|
|||
int fish_wcwidth(wchar_t wc) {
|
||||
// Check for VS16 which selects emoji presentation. This "promotes" a character like U+2764
|
||||
// (width 1) to an emoji (probably width 2). So treat it as width 1 so the sums work. See #2652.
|
||||
const int variation_selector_16 = 0xFE0F;
|
||||
// VS15 selects text presentation.
|
||||
const wchar_t variation_selector_16 = L'\uFE0F', variation_selector_15 = L'\uFE0E';
|
||||
if (wc == variation_selector_16) return 1;
|
||||
else if (wc == variation_selector_15) return 0;
|
||||
|
||||
int width = widechar_wcwidth(wc);
|
||||
switch (width) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user