Skip to content

Commit

Permalink
Include ASCII characters in "na" table
Browse files Browse the repository at this point in the history
Since we're now assigning "na" (narrow) characters width 1,
we can include the ASCII character ranges in the table.
  • Loading branch information
wedaly committed Aug 14, 2020
1 parent 1e492b2 commit 9d7065f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions runewidth_test.go
Expand Up @@ -164,6 +164,7 @@ var runewidthtests = []struct {
{'\u0300', 0, 0},
{'\u2028', 0, 0},
{'\u2029', 0, 0},
{'a', 1, 1}, // ASCII classified as "na" (narrow)
{'⟦', 1, 1}, // non-ASCII classified as "na" (narrow)
}

Expand Down
10 changes: 4 additions & 6 deletions script/generate.go
Expand Up @@ -92,12 +92,10 @@ func eastasian(out io.Writer, in io.Reader) error {
hi: r2,
})
case "Na":
if r1 > 0xFF {
na = append(na, rrange{
lo: r1,
hi: r2,
})
}
na = append(na, rrange{
lo: r1,
hi: r2,
})
case "N":
nu = append(nu, rrange{
lo: r1,
Expand Down

0 comments on commit 9d7065f

Please sign in to comment.