Skip to content
Snippets Groups Projects
Commit 36eb2c5a authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[overlay addon] Fix bad synchronization that was breaking gfm mode

Issue #2919
parent e9d3c124
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
overlay: CodeMirror.startState(overlay),
basePos: 0, baseCur: null,
overlayPos: 0, overlayCur: null,
lineSeen: null
streamSeen: null
};
},
copyState: function(state) {
......@@ -41,9 +41,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
},
token: function(stream, state) {
if (stream.sol() || stream.string != state.lineSeen ||
if (stream != state.streamSeen ||
Math.min(state.basePos, state.overlayPos) < stream.start) {
state.lineSeen = stream.string;
state.streamSeen = stream;
state.basePos = state.overlayPos = stream.start;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment