mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Treat return key correctly on Windows
To fix Reline::TestRendering#test_binding_for_vi_movement_mode. https://github.com/ruby/reline/commit/0df3d2a1dc
This commit is contained in:
parent
754bfc66f8
commit
26f31f880c
1 changed files with 7 additions and 1 deletions
|
@ -85,6 +85,7 @@ class Reline::Windows
|
|||
end
|
||||
end
|
||||
|
||||
VK_RETURN = 0x0D
|
||||
VK_MENU = 0x12
|
||||
VK_LMENU = 0xA4
|
||||
VK_CONTROL = 0x11
|
||||
|
@ -207,7 +208,12 @@ class Reline::Windows
|
|||
elsif char_code == 0 and control_key_state != 0
|
||||
# unknown
|
||||
else
|
||||
@@output_buf.concat(char.bytes)
|
||||
case virtual_key_code
|
||||
when VK_RETURN
|
||||
@@output_buf.push("\n".ord)
|
||||
else
|
||||
@@output_buf.concat(char.bytes)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue