Skip to content

Commit 48c2e8e

Browse files
committed
Fix workaround for webkit bug in rendering of overlong text nodes
Issue #1163
1 parent 2f37f66 commit 48c2e8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/codemirror.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ window.CodeMirror = (function() {
565565
node.style.display = "none";
566566
node.lineObj = null;
567567
} else {
568-
container.removeChild(node);
568+
node.parentNode.removeChild(node);
569569
}
570570
return next;
571571
}
@@ -3697,8 +3697,9 @@ window.CodeMirror = (function() {
36973697
while (!stream.eol()) {
36983698
var style = mode.token(stream, state);
36993699
if (stream.pos > 5000) {
3700+
flattenSpans = false;
37003701
// Webkit seems to refuse to render text nodes longer than 57444 characters
3701-
stream.pos = Math.min(text.length, stream.pos + 50000);
3702+
stream.pos = Math.min(text.length, stream.start + 50000);
37023703
style = null;
37033704
}
37043705
var substr = stream.current();

0 commit comments

Comments
 (0)