Skip to content

Commit

Permalink
Add comments about optimizing chars in ASCII range of UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 5, 2021
1 parent 9a77fc9 commit 3c13d93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/reline/unicode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def self.escape_for_print(str)

def self.get_mbchar_width(mbchar)
ord = mbchar.ord
if (0x00 <= ord and ord <= 0x1F)
if (0x00 <= ord and ord <= 0x1F) # in EscapedPairs
return 2
elsif (0x20 <= ord and ord <= 0x7E)
elsif (0x20 <= ord and ord <= 0x7E) # printable ASCII chars
return 1
end
m = mbchar.encode(Encoding::UTF_8).match(MBCharWidthRE)
Expand Down

0 comments on commit 3c13d93

Please sign in to comment.