From c7f81662c43d2aaae0105a754236b96b1225d2ec Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 11 Oct 2018 02:19:14 +0800 Subject: [PATCH] Fix: autoCloseBrackets is true by default --- edit.html | 2 ++ edit/codemirror-default.js | 1 + edit/codemirror-factory.js | 5 ----- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/edit.html b/edit.html index efe3d6a2..e02a6b4f 100644 --- a/edit.html +++ b/edit.html @@ -26,6 +26,8 @@ + + diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index e92be6e4..4bf9498e 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -9,6 +9,7 @@ } const defaults = { + autoCloseBrackets: prefs.get('editor.autoCloseBrackets'), extraKeys: Object.assign(CodeMirror.defaults.extraKeys || {}, { // independent of current keyMap 'Alt-Enter': 'toggleStyle', diff --git a/edit/codemirror-factory.js b/edit/codemirror-factory.js index cb5e4586..d2b201b3 100644 --- a/edit/codemirror-factory.js +++ b/edit/codemirror-factory.js @@ -58,11 +58,6 @@ const cmFactory = (() => { if (option === 'colorpicker') { return; } - // FIXME: is this an overhead? - if (option === 'autoCloseBrackets' && value) { - return loadScript('/vendor/codemirror/addon/edit/closebrackets.js') - .then(() => setOption(option, value)); - } if (option === 'theme') { const themeLink = $('#cm-theme'); // use non-localized 'default' internally