diff --git a/static/js/CodeMirror/codemirror.js b/static/js/CodeMirror/codemirror.js index b6d2d21bdd..bc5927b831 100644 --- a/static/js/CodeMirror/codemirror.js +++ b/static/js/CodeMirror/codemirror.js @@ -697,8 +697,8 @@ var CodeMirror = (function() { // Add these lines to the work array, so that they will be // highlighted. Adjust work lines if lines were added/removed. var newWork = [], lendiff = newText.length - nlines - 1; - for (var i = 0, l = work.length; i < l; ++i) { - var task = work[i]; + for (var j = 0, l = work.length; j < l; ++j) { + var task = work[j]; if (task < from.line) newWork.push(task); else if (task > to.line) newWork.push(task + lendiff); } @@ -727,12 +727,16 @@ var CodeMirror = (function() { }); } else { //TODO: update height here for widget blocks - doc.iter(from.line, i + newText.length, function(line) { + doc.iter(from.line, from.line + newText.length, function(line) { var l = line.text; if (l.length > maxLineLength) { maxLine = l; maxLineLength = l.length; maxWidth = null; recomputeMaxLength = false; } + if (line.isWidgetBlock) { + var guess = line.styles[1].size(line.text).height / textHeight(); + if (guess != line.height) updateLineHeight(line, guess); + } }); if (recomputeMaxLength) { maxLineLength = 0; maxLine = ""; maxWidth = null; diff --git a/templates/simplewiki_edit.html b/templates/simplewiki_edit.html index 82c0456473..1c5ebd40fc 100644 --- a/templates/simplewiki_edit.html +++ b/templates/simplewiki_edit.html @@ -39,7 +39,7 @@ mode: 'mitx_markdown', matchBrackets: true, theme: "default", - lineWrapping: true, + lineWrapping: false, }); //Store the inital contents so we can compare for unsaved changes