Skip to content

Commit adbf7bb

Browse files
Axel Lewenhauptmarijnh
authored andcommitted
Restore indentation when closing an array or generator.
1 parent 3080ea6 commit adbf7bb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mode/julia/julia.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,14 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
127127
}
128128

129129
if (inArray(state) && ch === ']') {
130-
if (currentScope(state) === "if") { state.scopes.pop(); }
131-
while (currentScope(state) === "for") { state.scopes.pop(); }
130+
while (currentScope(state) !== "[") { state.scopes.pop(); }
132131
state.scopes.pop();
133132
state.nestedArrays--;
134133
state.leavingExpr = true;
135134
}
136135

137136
if (inGenerator(state) && ch === ')') {
138-
if (currentScope(state) === "if") { state.scopes.pop(); }
139-
while (currentScope(state) === "for") { state.scopes.pop(); }
137+
while (currentScope(state) !== "(") { state.scopes.pop(); }
140138
state.scopes.pop();
141139
state.nestedGenerators--;
142140
state.leavingExpr = true;

0 commit comments

Comments
 (0)