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)