mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
Updated codemirror to 5.4.0
This commit is contained in:
parent
1d843c8ac2
commit
01685c255f
69 changed files with 2988 additions and 558 deletions
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue