I just upgraded CodeMirror to latest and have the following code now breaking:
// clear previous errors from editor window
for (var i = 0; i < layoutCodeEditor.lineCount(); i++) {
layoutCodeEditor.clearMarker(i);
layoutCodeEditor.setLineClass(i, null, null);
}
var valid = JSLINT(code);
var jsLintError = "";
if (!valid) {
jsLintError = JSLINT.error_report(JSLINT.data());
_.chain(JSLINT.errors).compact().each(function(e){
// show markers in the code edit window against lines with Jslint errors
layoutCodeEditor.setMarker((+e.line) - 1, "●", "errors");
layoutCodeEditor.setLineClass(+(e.line) - 1, null, "errorLine");
})
}
seems like the setMarker/clearMarker and setLineClass functions have been removed. What’s their equivalents now?
These changes, among many others, are covered in the Upgrading to version 3 page on the CodeMirror site.
The marker functions have changed as a consequence of moving to multiple gutters:
The line class change is more straightforward: