Permalink
Browse files

Merge pull request #86 from adobe/nj/issue-2782

Avoid scrolling to cursor position in a non-visible editor
  • Loading branch information...
2 parents 8ce4f8a + f9b7259 commit c99ffd13eff8256e58bf77b4eefbf9d95ed8f705 @gruehle gruehle committed Feb 12, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/codemirror.js
View
@@ -1237,7 +1237,7 @@ window.CodeMirror = (function() {
var newScrollPos, updated;
if (op.updateScrollPos) {
newScrollPos = op.updateScrollPos;
- } else if (op.selectionChanged) {
+ } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible
var coords = cursorCoords(cm, doc.sel.head);
newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);
}

0 comments on commit c99ffd1

Please sign in to comment.