Fix: autoCloseBrackets is true by default

This commit is contained in:
eight 2018-10-11 02:19:14 +08:00
parent f3a103645d
commit c7f81662c4
3 changed files with 3 additions and 5 deletions

View File

@ -26,6 +26,8 @@
<link href="vendor/codemirror/addon/dialog/dialog.css" rel="stylesheet">
<script src="vendor/codemirror/addon/dialog/dialog.js"></script>
<script src="vendor/codemirror/addon/edit/closebrackets.js"></script>
<link href="vendor/codemirror/addon/search/matchesonscrollbar.css" rel="stylesheet">
<script src="vendor/codemirror/addon/search/matchesonscrollbar.js"></script>
<script src="vendor/codemirror/addon/scroll/annotatescrollbar.js"></script>

View File

@ -9,6 +9,7 @@
}
const defaults = {
autoCloseBrackets: prefs.get('editor.autoCloseBrackets'),
extraKeys: Object.assign(CodeMirror.defaults.extraKeys || {}, {
// independent of current keyMap
'Alt-Enter': 'toggleStyle',

View File

@ -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