Properly fix the scrolling issues

This reverts 2369dd5db6bfc895d7b1240e3b31d46a1699a887 "Handle jump to line as in
xterm" and a6c4eb0a64d5ae445ca74abb4290394dbfb676e0 "Fix another
jump-out-of-the-scroll-region bug".