Skip to content

Commit 3c13d93

Browse files
committed
Add comments about optimizing chars in ASCII range of UTF-8
1 parent 9a77fc9 commit 3c13d93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/reline/unicode.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def self.escape_for_print(str)
101101

102102
def self.get_mbchar_width(mbchar)
103103
ord = mbchar.ord
104-
if (0x00 <= ord and ord <= 0x1F)
104+
if (0x00 <= ord and ord <= 0x1F) # in EscapedPairs
105105
return 2
106-
elsif (0x20 <= ord and ord <= 0x7E)
106+
elsif (0x20 <= ord and ord <= 0x7E) # printable ASCII chars
107107
return 1
108108
end
109109
m = mbchar.encode(Encoding::UTF_8).match(MBCharWidthRE)

0 commit comments

Comments
 (0)