diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index eeb1a930..2b653eb6 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -109,8 +109,13 @@ export default class CodeEditor extends React.Component { scrollPastEnd: this.props.scrollPastEnd, inputStyle: 'textarea', dragDrop: false, + foldGutter: true, + gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'], autoCloseBrackets: true, extraKeys: { + 'Ctrl-G': function (cm) { + cm.foldCode(cm.getCursor()) + }, Tab: function (cm) { const cursor = cm.getCursor() const line = cm.getLine(cursor.line) diff --git a/browser/main/global.styl b/browser/main/global.styl index 1b40587c..8d0e3e37 100644 --- a/browser/main/global.styl +++ b/browser/main/global.styl @@ -108,6 +108,22 @@ body[data-theme="dark"] background #B1D7FE ::selection background #B1D7FE +.CodeMirror-foldmarker + font-family: arial + +.CodeMirror-foldgutter + width: .7em + +//.CodeMirror-foldgutter-open, +//.CodeMirror-foldgutter-folded +// color: #555 +// cursor: pointer + +.CodeMirror-foldgutter-open:after + content: "\25BE" + +.CodeMirror-foldgutter-folded:after + content: "\25B8" .sortableItemHelper z-index modalZIndex + 5 diff --git a/lib/main.html b/lib/main.html index 830d3b48..538fd8ec 100644 --- a/lib/main.html +++ b/lib/main.html @@ -92,6 +92,11 @@ + + + + +