Skip to content

Commit eb988d1

Browse files
committed
Verify indentation was preserved before accepting a state as identical
This should prevent problems with parts of the document having a 'corrupt' state when quickly scrolling down a big document.
1 parent e7b561f commit eb988d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/codemirror.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,8 @@ var CodeMirror = (function() {
16081608
if (hadState && compare(hadState, state)) return true;
16091609
} else {
16101610
if (changed !== false || !hadState) unchanged = 0;
1611-
else if (++unchanged > 3) return true;
1611+
else if (++unchanged > 3 && (!mode.indent || mode.indent(hadState, "") == mode.indent(state, "")))
1612+
return true;
16121613
}
16131614
++i;
16141615
});

0 commit comments

Comments
 (0)