Skip to content

Commit 6a70db0

Browse files
committed
fix: handle transparent zero-width ligatures
1 parent 84adab0 commit 6a70db0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/unicode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,10 +1768,10 @@ def emit_module(
17681768
} else if cp > end {
17691769
low = mid + 1
17701770
} else {
1771-
return true
1771+
return false
17721772
}
17731773
}
1774-
false
1774+
true
17751775
}
17761776
}
17771777

tables.mbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,10 @@ fn is_transparent_zero_width(c : Char) -> Bool {
11381138
} else if cp > end {
11391139
low = mid + 1
11401140
} else {
1141-
return true
1141+
return false
11421142
}
11431143
}
1144-
false
1144+
true
11451145
}
11461146
}
11471147

unicodewidth_test.mbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ test "test_arabic_lam_alef" {
322322
assert_str_width("\u{6B8}\u{FE0E}\u{627}", 1, 1)
323323
assert_str_width("\u{6B8}\u{FE0F}\u{627}", 1, 1)
324324
assert_str_width("\u{6B8}\u{17B5}\u{627}", 1, 1)
325-
assert_str_width("\u{644}\u{605}\u{623}", 1, 1)
326-
assert_str_width("\u{6B8}\u{605}\u{627}", 1, 1)
325+
assert_str_width("\u{644}\u{605}\u{623}", 2, 2)
326+
assert_str_width("\u{6B8}\u{605}\u{627}", 2, 2)
327327
assert_str_width("\u{644}\u{644}\u{623}", 2, 2)
328328
assert_str_width("\u{644}\u{644}\u{627}", 2, 2)
329329
assert_str_width("\u{6B8}\u{6B8}\u{623}", 2, 2)

0 commit comments

Comments
 (0)