marijnh/CodeMirror2 — pull request #666 by peterflynn (2012-07-27 01:09:43+00:00)
Title: Fix vertical scrolling bug (#665)

calculateScrollPos() was reading scrollHeight from the wrong element, so atBottom became true almost any the time the cursor moved past the bottom edge of the viewport. So scrolling tries to jump to bottom of document on almost any downward cursor movement.

I'm not sure how this led all the other jumping around (moving back upward, then down again, but never settling on the actual cursor position), but it fixes all cases I was able to repro before (both #665 and #664).