From 183774f6376fb1e545138dd699617ad11f651b28 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Thu, 29 Mar 2012 22:27:55 -0700 Subject: [PATCH] Fixed codemirror arrowkey navigation bug. --- static/js/CodeMirror/codemirror.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/CodeMirror/codemirror.js b/static/js/CodeMirror/codemirror.js index 35d6c25103..ff127f80f6 100644 --- a/static/js/CodeMirror/codemirror.js +++ b/static/js/CodeMirror/codemirror.js @@ -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);