Skip to content

Commit 50178a5

Browse files
akingmarijnh
authored andcommitted
Fix brace indenting for clojure maps.
1 parent 6a86c3d commit 50178a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mode/clojure/clojure.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ CodeMirror.defineMode("clojure", function (config, mode) {
142142
returnType = COMMENT;
143143
} else if (isNumber(ch,stream)){
144144
returnType = NUMBER;
145-
} else if (ch == "(" || ch == "[") {
145+
} else if (ch == "(" || ch == "[" || ch == "{" ) {
146146
var keyWord = '', indentTemp = stream.column(), letter;
147147
/**
148148
Either
@@ -172,9 +172,9 @@ CodeMirror.defineMode("clojure", function (config, mode) {
172172
stream.backUp(stream.current().length - 1); // undo all the eating
173173

174174
returnType = BRACKET;
175-
} else if (ch == ")" || ch == "]") {
175+
} else if (ch == ")" || ch == "]" || ch == "}") {
176176
returnType = BRACKET;
177-
if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) {
177+
if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) {
178178
popStack(state);
179179
}
180180
} else if ( ch == ":" ) {

0 commit comments

Comments
 (0)