Skip to content

Commit

Permalink
Merge branch '2.0-disable-si' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarhane committed Dec 7, 2016
2 parents d9fd591 + 964b777 commit cb83e51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion app/components/codemirror-cypher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,18 @@
return style;
},
indent: function(state, textAfter) {
return 0;
var firstChar = textAfter && textAfter.charAt(0);
var context = state.context;
if (/[\]\}]/.test(firstChar)) {
while (context && context.type === "pattern") {
context = context.prev;
}
}
var closing = context && firstChar === context.type;
if (!context) return 0;
if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent;
if (context.align) return context.col + (closing ? 0 : 1);
return context.indent + (closing ? 0 : indentUnit);
}
};
});
Expand Down
2 changes: 1 addition & 1 deletion app/views/partials/editor.jade
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.view-editor
span(ng-class="{'one-line': editorOneLine, 'disable-highlighting': disableHighlighting}")
.prompt.code-style $
ui-codemirror('ui-codemirror-opts'="{gutters:['cypher-hints'], theme: 'neo', mode: 'cypher', autofocus: true, lineNumbers: true, lineWrapping: true, onLoad: codemirrorLoaded}",
ui-codemirror('ui-codemirror-opts'="{gutters:['cypher-hints'], theme: 'neo', mode: 'cypher', autofocus: true, lineNumbers: true, lineWrapping: true, onLoad: codemirrorLoaded, smartIndent: false}",
ng-model='editor.content',
placeholder='{{motd.tip}}'
)
Expand Down

0 comments on commit cb83e51

Please sign in to comment.