diff options
author | aycabta <aycabta@gmail.com> | 2019-05-29 18:52:20 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-29 18:52:34 +0900 |
commit | fafcbe0eb0af0aa25ca1fa6e162e081bb78a8107 (patch) | |
tree | 8d4ac93a62c60f0bc5a3834833f27d3015824476 | |
parent | 5ceff480c2c1696e9893a1e5e09e39f8425c6c5a (diff) | |
download | ruby-fafcbe0eb0af0aa25ca1fa6e162e081bb78a8107.tar.gz |
Use reversed get_screen_size correctly on Windows
-rw-r--r-- | lib/reline/windows.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 7ba28adb5a..b64ea97295 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -150,12 +150,12 @@ class Reline::Windows @@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi) cursor = csbi[4, 4].unpack('L').first written = 0.chr * 4 - @@FillConsoleOutputCharacter.call(@@hConsoleHandle, 0x20, get_screen_size.first - cursor_pos.x, cursor, written) + @@FillConsoleOutputCharacter.call(@@hConsoleHandle, 0x20, get_screen_size.last - cursor_pos.x, cursor, written) end def self.scroll_down(val) return if val.zero? - scroll_rectangle = [0, val, get_screen_size.last, get_screen_size.first].pack('s4') + scroll_rectangle = [0, val, get_screen_size.first, get_screen_size.last].pack('s4') destination_origin = 0 # y * 65536 + x fill = [' '.ord, 0].pack('SS') @@ScrollConsoleScreenBuffer.call(@@hConsoleHandle, scroll_rectangle, nil, destination_origin, fill) |