Have wcwidth() return 0 for marks instead of -1

Since kitty always treats marks as combinig chars, this allows us to
remove a few unnecessary branches
This commit is contained in:
Kovid Goyal
2018-02-05 10:06:05 +05:30
parent c572b8bb1a
commit fbe4d036d8
5 changed files with 533 additions and 538 deletions

View File

@@ -217,9 +217,8 @@ def gen_wcwidth():
p('\tswitch(code) {')
non_printing = class_maps['Cc'] | class_maps['Cf'] | class_maps['Cs']
add(p, 'Null', {0}, 0)
add(p, 'Marks', marks | {0}, 0)
add(p, 'Non-printing characters', non_printing, -1)
add(p, 'Marks', marks, -1)
add(p, 'Private use', class_maps['Co'], -3)
add(p, 'Text Presentation', emoji_categories['Emoji'] - emoji_categories['Emoji_Presentation'], 1)
add(p, 'East Asian ambiguous width', ambiguous, -2)