mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[ruby/reline] Return 1 when char width not found
This fixes ruby/reline#261.
3cf1213014
This commit is contained in:
parent
b88be10094
commit
dc9e33016c
2 changed files with 9 additions and 0 deletions
|
@ -108,6 +108,7 @@ class Reline::Unicode
|
|||
end
|
||||
m = mbchar.encode(Encoding::UTF_8).match(MBCharWidthRE)
|
||||
case
|
||||
when m.nil? then 1 # TODO should be U+FFFD <20> REPLACEMENT CHARACTER
|
||||
when m[:width_2_1], m[:width_2_2] then 2
|
||||
when m[:width_3] then 3
|
||||
when m[:width_0] then 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue