Your comments

I would expect the highlighted area to move partially off the screen as this area represents your view of the code.  Any code in the highlighted area should be visible on the screen.


However I agree that the horizontal position should not reset when you try to scroll vertically.  Maybe you should be able to move the highlighted area in both dimensions and scroll both horizonally and vertically?