From a051a0bcbf70805687b38543368eea6e8a819265 Mon Sep 17 00:00:00 2001 From: Fabio Spampinato Date: Sun, 6 Jan 2019 18:10:07 +0100 Subject: [PATCH] Improved CodeMirror configuration --- src/renderer/components/main/code/index.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/renderer/components/main/code/index.tsx b/src/renderer/components/main/code/index.tsx index 8ae4b7c..1abec0c 100644 --- a/src/renderer/components/main/code/index.tsx +++ b/src/renderer/components/main/code/index.tsx @@ -21,14 +21,14 @@ const options: any = { //TSC indentUnit: 2, indentWithTabs: false, lineNumbers: false, - lineSeparator: '\n', lineWrapping: true, mode: 'noty', - scrollbarStyle: 'null', + scrollbarStyle: 'native', smartIndent: false, tabSize: 2, undoDepth: 1000, keyMap: 'sublime', + viewportMargin: Infinity, extraKeys: { 'Backspace': 'delCharBefore', [`${CTMD}-Z`]: 'undo', @@ -58,18 +58,12 @@ const options: any = { //TSC } }; +Utils.defineMode (); + /* CODE */ class Code extends React.Component { - constructor ( props ) { - - super ( props ); - - Utils.defineMode (); - - } - shouldComponentUpdate ( nextProps ) { return this.props.id !== nextProps.id;