summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormanga_osyo <manga.osyo@gmail.com>2020-11-12 12:36:48 +0900
committeraycabta <aycabta@gmail.com>2020-12-05 02:58:58 +0900
commite47e5db88943b7421f802f1fdfd34ba2224ec057 (patch)
tree38fabcaf5ed2a6fb34db0a2609fda64cb20b1cb7 /lib
parentff4656ee64f0dc7ea7eb0f87d90dd718948f4de3 (diff)
[ruby/reline] Fix crash to input `é`. refs #174
https://github.com/ruby/reline/commit/ba5e267e5f
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/unicode.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/reline/unicode.rb b/lib/reline/unicode.rb
index df2f6719a4..d482997bab 100644
--- a/lib/reline/unicode.rb
+++ b/lib/reline/unicode.rb
@@ -89,6 +89,9 @@ class Reline::Unicode
| #{ EastAsianWidth::TYPE_NA }
| #{ EastAsianWidth::TYPE_N }
)
+ | (?<ambiguous_width>
+ #{EastAsianWidth::TYPE_A}
+ )
/x
def self.get_mbchar_width(mbchar)
@@ -98,6 +101,7 @@ class Reline::Unicode
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