code folding in editor settings

This commit is contained in:
ilvalle
2013-10-19 12:22:24 +02:00
parent e9c884d674
commit b5f17b1acb
5 changed files with 47 additions and 18 deletions
@@ -54,15 +54,18 @@
theme: current_theme,
tabMode: "shift",
lineWrapping: true,
gutters: ["CodeMirror-linenumbers", "breakpoints"],
foldGutter: current_codefolding,
gutters: ["CodeMirror-linenumbers", "breakpoints", "CodeMirror-foldgutter"],
keyMap: current_editor,
matchBrackets: true,
autofocus: false,
height: "350px",
showTrailingSpace: true
});
editor.foldCode(CodeMirror.Pos(8, 0));
editor.on("gutterClick", function(cm, n) {
editor.on("gutterClick", function(cm, n, gutter) {
if (gutter !== "breakpoints" ) return;
var info = cm.lineInfo(n);
cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
sel = {start: n, end: n, data: ''};