Skip to content

Commit

Permalink
[javascript mode] Also count on semicolon omittance in var lists
Browse files Browse the repository at this point in the history
Issue #898
  • Loading branch information
marijnh committed Oct 19, 2012
1 parent 579dcf1 commit 0985a76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mode/javascript/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
register(value);
return isTS ? cont(maybetype, vardef2) : cont(vardef2);
}
return cont();
return pass();
}
function vardef2(type, value) {
if (value == "=") return cont(expression, vardef2);
Expand Down Expand Up @@ -388,7 +388,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
var type = lexical.type, closing = firstChar == type;
if (type == "vardef") return lexical.indented + 4;
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0);
else if (type == "form" && firstChar == "{") return lexical.indented;
else if (type == "form") return lexical.indented + indentUnit;
else if (type == "stat")
Expand Down

0 comments on commit 0985a76

Please sign in to comment.