mirror of
https://github.com/powerline/powerline.git
synced 2025-07-23 13:55:45 +02:00
Fix code: unichr on UCS-2 builds cannot emit surrogate pairs
This commit is contained in:
parent
6dc585b7ee
commit
531d3e60c6
@ -212,11 +212,7 @@ strwidth_ucs_4.__doc__ = _strwidth_documentation.format(
|
||||
def strwidth_ucs_2(width_data, string):
|
||||
return sum(((
|
||||
(
|
||||
width_data[
|
||||
east_asian_width(
|
||||
unichr(surrogate_pair_to_character(ord(string[i - 1]), ord(symbol)))
|
||||
)
|
||||
]
|
||||
width_data[east_asian_width(string[i - 1] + symbol)]
|
||||
) if 0xDC00 <= ord(symbol) <= 0xDFFF else (
|
||||
0
|
||||
) if combining(symbol) or 0xD800 <= ord(symbol) <= 0xDBFF else (
|
||||
|
Loading…
x
Reference in New Issue
Block a user