TagSpaces is an offline, open source, document manager with tagging support
code styling
uggrockc5b72c8f9799
diff --git a/data/ext/editorText/extension.js b/data/ext/editorText/extension.jsindex 2b29eed31..270fb9fa7 100644--- a/data/ext/editorText/extension.js+++ b/data/ext/editorText/extension.js@@ -45,43 +45,42 @@ define(function(require, exports, module) {'css!' + extensionDirectory + '/codemirror/lib/codemirror.css','css!' + extensionDirectory + '/extension.css'], function(CodeMirror) {-- var cursorBlinkRate = isViewerMode ? -1 : 530; // disabling the blinking cursor in readonly mode- var lineNumbers = !isViewerMode;- //var saveKB = convertMouseTrapToCodeMirrorKeyBindings(TSCORE.Config.getSaveDocumentKeyBinding());- var keys = {};-- keys[convertMouseTrapToCodeMirrorKeyBindings(TSCORE.Config.getSaveDocumentKeyBinding())] = function() {- TSCORE.FileOpener.saveFile();- };-- keys[convertMouseTrapToCodeMirrorKeyBindings(TSCORE.Config.getCloseViewerKeyBinding())] = function() {- TSCORE.FileOpener.closeFile();- };-- cmEditor = new CodeMirror(document.getElementById("code"), {- fixedGutter: false,- mode: mode,- lineNumbers: lineNumbers,- lineWrapping: true,- tabSize: 2,- collapseRange: true,- matchBrackets: true,- cursorBlinkRate: cursorBlinkRate,- readOnly: isViewerMode ? "nocursor" : isViewerMode,- autofocus: true,- //theme: "lesser-dark",- //extraKeys: keys // workarrounded with bindGlobal plugin for mousetrap- });-- cmEditor.on("change", function() {- if (contentLoaded) {- TSCORE.FileOpener.setFileChanged(true);- }- });-- cmEditor.setSize("100%", "100%");- TSCORE.IO.loadTextFile(filePath);+ var cursorBlinkRate = isViewerMode ? -1 : 530; // disabling the blinking cursor in readonly mode+ var lineNumbers = !isViewerMode;+ //var saveKB = convertMouseTrapToCodeMirrorKeyBindings(TSCORE.Config.getSaveDocumentKeyBinding());+ var keys = {};++ keys[convertMouseTrapToCodeMirrorKeyBindings(TSCORE.Config.getSaveDocumentKeyBinding())] = function() {+ TSCORE.FileOpener.saveFile();+ };++ keys[convertMouseTrapToCodeMirrorKeyBindings(TSCORE.Config.getCloseViewerKeyBinding())] = function() {+ TSCORE.FileOpener.closeFile();+ };++ cmEditor = new CodeMirror(document.getElementById("code"), {+ fixedGutter: false,+ mode: mode,+ lineNumbers: lineNumbers,+ lineWrapping: true,+ tabSize: 2,+ collapseRange: true,+ matchBrackets: true,+ cursorBlinkRate: cursorBlinkRate,+ readOnly: isViewerMode ? "nocursor" : isViewerMode,+ autofocus: true,+ //theme: "lesser-dark",+ //extraKeys: keys // workarrounded with bindGlobal plugin for mousetrap+ });++ cmEditor.on("change", function() {+ if (contentLoaded) {+ TSCORE.FileOpener.setFileChanged(true);+ }+ });++ cmEditor.setSize("100%", "100%");+ TSCORE.IO.loadTextFile(filePath);});};