dedupe linter.enableForEditor calls

This commit is contained in:
tophf 2020-11-13 19:02:33 +03:00
parent 184b6d4f7c
commit a06697808f
3 changed files with 1 additions and 2 deletions

View File

@ -89,6 +89,7 @@ lazyInit();
dirty.onChange(updateDirty);
await editor.ready;
setTimeout(() => editor.getEditors().forEach(linter.enableForEditor));
// enabling after init to prevent flash of validation failure on an empty name
$('#name').required = !editor.isUsercss;
$('#save-button').onclick = editor.save;

View File

@ -517,7 +517,6 @@ function SectionsEditor() {
if (!originalSections.length) {
setGlobalProgress();
requestAnimationFrame(fitToAvailableSpace);
sections.forEach(({cm}) => setTimeout(linter.enableForEditor, 0, cm));
done();
} else {
setTimeout(chunk);

View File

@ -90,7 +90,6 @@ function SourceEditor() {
linter.run();
updateLinterSwitch();
});
debounce(linter.enableForEditor, 0, cm);
if (!$.isTextInput(document.activeElement)) {
cm.focus();
}