Fixed codemirror arrowkey navigation bug.

This commit is contained in:
Bridger Maxwell
2012-03-29 22:27:55 -07:00
parent d7383bf3c4
commit 183774f637

View File

@@ -1295,9 +1295,9 @@ var CodeMirror = (function() {
if (goalColumn != null) pos.x = goalColumn;
if (unit == "page") dist = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight);
else if (unit == "line") {
if (dir > 0) {
dist = Math.ceil(getLine(pos.line).height);
} else dist = 1;
var line = getLine(pos.line);
if (dir > 0 && line.widgetFunction) dist = Math.ceil(getLine(pos.line).height);
else dist = 1;
dist *= textHeight();
}
var target = coordsChar(loc.x, loc.y + dist * dir + 2);