Updated codemirror to 5.4.0
This commit is contained in:
12
public/vendor/codemirror/addon/lint/lint.js
vendored
12
public/vendor/codemirror/addon/lint/lint.js
vendored
@@ -63,11 +63,9 @@
|
||||
this.onMouseOver = function(e) { onMouseOver(cm, e); };
|
||||
}
|
||||
|
||||
function parseOptions(cm, options) {
|
||||
function parseOptions(_cm, options) {
|
||||
if (options instanceof Function) return {getAnnotations: options};
|
||||
if (!options || options === true) options = {};
|
||||
if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint");
|
||||
if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)");
|
||||
return options;
|
||||
}
|
||||
|
||||
@@ -120,10 +118,12 @@
|
||||
function startLinting(cm) {
|
||||
var state = cm.state.lint, options = state.options;
|
||||
var passOptions = options.options || options; // Support deprecated passing of `options` property in options
|
||||
if (options.async || options.getAnnotations.async)
|
||||
options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
|
||||
var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
|
||||
if (!getAnnotations) return;
|
||||
if (options.async || getAnnotations.async)
|
||||
getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
|
||||
else
|
||||
updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm));
|
||||
updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
|
||||
}
|
||||
|
||||
function updateLinting(cm, annotationsNotSorted) {
|
||||
|
||||
Reference in New Issue
Block a user