diff --git a/gwidth.go b/gwidth.go index 04fcd4a..7165688 100644 --- a/gwidth.go +++ b/gwidth.go @@ -11,9 +11,12 @@ func gwidth(s string, unicode bool) int { } total := 0 for _, r := range s { - if r == 0xFE0F { - // runewidth incorrectly thinks a VS16 selector is 1 - // wide + if r >= 0xFE00 && r <= 0xFE0F { + // Variation Selectors 1 - 16 + continue + } + if r >= 0xE0100 && r <= 0xE01EF { + // Variation Selectors 17-256 continue } total += runewidth.RuneWidth(r)