Skip to content

Commit 5ae735c

Browse files
committed
[javascript mode] Use electricInput rather than electricChars
To be more intelligent about what kind of lines to indent.
1 parent b7b3943 commit 5ae735c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/javascript/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
656656
else return lexical.indented + (closing ? 0 : indentUnit);
657657
},
658658

659-
electricChars: ":{}",
659+
electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
660660
blockCommentStart: jsonMode ? null : "/*",
661661
blockCommentEnd: jsonMode ? null : "*/",
662662
lineComment: jsonMode ? null : "//",

0 commit comments

Comments
 (0)