1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Support Meta key in Reline

This commit is contained in:
aycabta 2019-05-24 23:38:40 +09:00
parent 2d34087a38
commit eb4e774711
11 changed files with 282 additions and 217 deletions

View file

@ -40,13 +40,13 @@ class Reline::TestCase < Test::Unit::TestCase
eighth_bit = 0b10000000
byte = c.bytes.first
if byte.allbits?(eighth_bit)
@line_editor.input_key("\e".ord)
byte ^= eighth_bit
@line_editor.input_key(Reline::Key.new(byte ^ eighth_bit, byte, true))
else
@line_editor.input_key(Reline::Key.new(byte, byte, false))
end
@line_editor.input_key(byte)
else
c.bytes.each do |b|
@line_editor.input_key(b)
@line_editor.input_key(Reline::Key.new(b, b, false))
end
end
end