зеркало из https://github.com/github/ruby.git
[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:
Родитель
754bfc66f8
Коммит
26f31f880c
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче