Skip to content

Commit

Permalink
[ruby/reline] Fix crash to input é. refs #174
Browse files Browse the repository at this point in the history
  • Loading branch information
osyo-manga authored and aycabta committed Dec 4, 2020
1 parent ff4656e commit e47e5db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/reline/unicode.rb
Expand Up @@ -89,6 +89,9 @@ def self.escape_for_print(str)
| #{ EastAsianWidth::TYPE_NA }
| #{ EastAsianWidth::TYPE_N }
)
| (?<ambiguous_width>
#{EastAsianWidth::TYPE_A}
)
/x

def self.get_mbchar_width(mbchar)
Expand All @@ -98,6 +101,7 @@ def self.get_mbchar_width(mbchar)
when m[:width_3] then 3
when m[:width_0] then 0
when m[:width_1] then 1
when m[:ambiguous_width] then Reline.ambiguous_width
else
nil
end
Expand Down

0 comments on commit e47e5db

Please sign in to comment.