From 11016efdb13c391175d0d409c6c620658e3e9b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A5=98=EC=84=A0=EC=9E=84?= Date: Tue, 28 Apr 2020 14:39:25 +0900 Subject: [PATCH] fix: not working shortcut of codemirror in markdown editor (#951) --- apps/editor/src/js/codeMirrorExt.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/editor/src/js/codeMirrorExt.js b/apps/editor/src/js/codeMirrorExt.js index 6221eb8751..4d6d767d37 100644 --- a/apps/editor/src/js/codeMirrorExt.js +++ b/apps/editor/src/js/codeMirrorExt.js @@ -42,21 +42,20 @@ class CodeMirrorExt { this.editorContainerEl.appendChild(cmTextarea); - options = extend( - { - lineWrapping: true, - theme: 'default', - extraKeys: { - 'Shift-Tab': 'indentLess', - 'Alt-Up': 'replaceLineTextToUpper', - 'Alt-Down': 'replaceLineTextToLower' - }, - indentUnit: 4, - cursorScrollMargin: 12, - specialCharPlaceholder: () => document.createElement('span') + options = { + ...options, + lineWrapping: true, + theme: 'default', + extraKeys: { + ...options.extraKeys, + 'Shift-Tab': 'indentLess', + 'Alt-Up': 'replaceLineTextToUpper', + 'Alt-Down': 'replaceLineTextToLower' }, - options - ); + indentUnit: 4, + cursorScrollMargin: 12, + specialCharPlaceholder: () => document.createElement('span') + }; this.cm = CodeMirror.fromTextArea(cmTextarea, options); }