Skip to content

Commit 035f535

Browse files
committed
Fix bug that prevented the line length to be updated in some cases
(Which would make horizonal scrollbars 'stick' after the wide lines had been deleted.)
1 parent 2bf353a commit 035f535

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/codemirror.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ var CodeMirror = (function() {
397397

398398
function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
399399
var recomputeMaxLength = false, maxLineLength = maxLine.length;
400-
for (var i = from.line; i < to.line; ++i) {
400+
for (var i = from.line; i <= to.line; ++i) {
401401
if (lines[i].text.length == maxLineLength) {recomputeMaxLength = true; break;}
402402
}
403403

@@ -436,7 +436,7 @@ var CodeMirror = (function() {
436436
}
437437
}
438438
if (recomputeMaxLength) {
439-
maxLineLength = 0;
439+
maxLineLength = 0; maxLine = "";
440440
for (var i = 0, e = lines.length; i < e; ++i) {
441441
var l = lines[i].text;
442442
if (l.length > maxLineLength) {

0 commit comments

Comments
 (0)