Skip to content

Commit 3704970

Browse files
committed
Don't force a width on IE7
It produces a bogus horizontal scrollbar there.
1 parent 3d786d4 commit 3704970

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/codemirror.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,8 +1983,10 @@ window.CodeMirror = (function() {
19831983
if (updateMaxLine) computeMaxLength();
19841984
if (maxLineChanged && !options.lineWrapping) {
19851985
var cursorWidth = widthForcer.offsetWidth, left = measureLine(maxLine, maxLine.text.length).left;
1986-
widthForcer.style.left = left + "px";
1987-
lineSpace.style.minWidth = (left + cursorWidth) + "px";
1986+
if (!ie_lt8) {
1987+
widthForcer.style.left = left + "px";
1988+
lineSpace.style.minWidth = (left + cursorWidth) + "px";
1989+
}
19881990
maxLineChanged = false;
19891991
}
19901992
var newScrollPos, updated;

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ testCM("selectionPos", function(cm) {
363363
}
364364
}
365365
is(sawTop && sawBottom && sawMiddle, "all parts");
366-
});
366+
}, null, ie_lt8);
367367

368368
testCM("restoreHistory", function(cm) {
369369
cm.setValue("abc\ndef");

0 commit comments

Comments
 (0)