diff --git a/edit/lint.js b/edit/lint.js index 09dd6bc4..0fc9d2b3 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -144,6 +144,10 @@ function updateLinter({immediately} = {}) { const linter = prefs.get('editor.linter'); const GUTTERS_CLASS = 'CodeMirror-lint-markers'; + loadLinterAssets(linter).then(updateEditors); + $('#linter-settings').style.display = !linter ? 'none' : 'inline-block'; + $('#lint').style.display = 'none'; + function updateEditors() { CodeMirror.defaults.lint = linterConfig.getForCodeMirror(linter); const guttersOption = prepareGuttersOption(); @@ -182,15 +186,6 @@ function updateLinter({immediately} = {}) { el.remove(); } } - - // load scripts - loadLinterAssets(linter).then(() => { - updateEditors(); - }); - $('#linter-settings').style.display = !linter ? 'none' : 'inline-block'; - if (!linter) { - $('#lint').style.display = 'none'; - } } function updateLintReport(cm, delay) {