Fix: hook/unhook -> enableForEditor/disableForEditor
This commit is contained in:
parent
47c6834331
commit
0482ac5ee0
|
@ -10,8 +10,8 @@ var linter = (() => {
|
|||
return {
|
||||
register,
|
||||
refresh,
|
||||
hook,
|
||||
unhook,
|
||||
enableForEditor,
|
||||
disableForEditor,
|
||||
onChange,
|
||||
onUnhook
|
||||
};
|
||||
|
@ -30,12 +30,12 @@ var linter = (() => {
|
|||
}
|
||||
}
|
||||
|
||||
function hook(cm) {
|
||||
function enableForEditor(cm) {
|
||||
cm.setOption('lint', {onUpdateLinting, getAnnotations});
|
||||
cms.add(cm);
|
||||
}
|
||||
|
||||
function unhook(cm) {
|
||||
function disableForEditor(cm) {
|
||||
cm.setOption('lint', false);
|
||||
cms.delete(cm);
|
||||
for (const cb of unhookCallbacks) {
|
||||
|
|
|
@ -151,7 +151,7 @@ function addSection(event, section) {
|
|||
sections.appendChild(div);
|
||||
cm = setupCodeMirror(div, code);
|
||||
}
|
||||
linter.hook(cm);
|
||||
linter.enableForEditor(cm);
|
||||
linterReport.refresh();
|
||||
div.CodeMirror = cm;
|
||||
setCleanSection(div);
|
||||
|
@ -481,7 +481,7 @@ function removeSection(event) {
|
|||
setCleanItem(section, false);
|
||||
updateTitle();
|
||||
cm.focus();
|
||||
linter.hook(cm);
|
||||
linter.enableForEditor(cm);
|
||||
linterReport.refresh();
|
||||
};
|
||||
section.insertAdjacentElement('afterend', stub);
|
||||
|
@ -489,7 +489,7 @@ function removeSection(event) {
|
|||
setCleanItem($('#sections'), false);
|
||||
removeAreaAndSetDirty(section);
|
||||
editors.splice(editors.indexOf(cm), 1);
|
||||
linter.unhook(cm);
|
||||
linter.disableForEditor(cm);
|
||||
linterReport.refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ function createSourceEditor(style) {
|
|||
updateMeta();
|
||||
});
|
||||
|
||||
linter.hook(cm);
|
||||
linter.enableForEditor(cm);
|
||||
|
||||
updateMeta().then(() => {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user