Skip to content

Commit a073d18

Browse files
committed
Remove mode-mutating kludge in continuecomment
1 parent dcdf014 commit a073d18

4 files changed

Lines changed: 3 additions & 5 deletions

File tree

addon/comment/continuecomment.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
else // Plain browser env
1010
mod(CodeMirror);
1111
})(function(CodeMirror) {
12-
var modes = ["clike", "css", "javascript"];
13-
14-
for (var i = 0; i < modes.length; ++i)
15-
CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "});
16-
1712
function continueComment(cm) {
1813
if (cm.getOption("disableInput")) return CodeMirror.Pass;
1914
var ranges = cm.listSelections(), mode, inserts = [];

mode/clike/clike.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
244244
electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
245245
blockCommentStart: "/*",
246246
blockCommentEnd: "*/",
247+
blockCommentContinue: " * ",
247248
lineComment: "//",
248249
fold: "brace"
249250
};

mode/css/css.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
410410
electricChars: "}",
411411
blockCommentStart: "/*",
412412
blockCommentEnd: "*/",
413+
blockCommentContinue: " * ",
413414
lineComment: lineComment,
414415
fold: "brace"
415416
};

mode/javascript/javascript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
821821
electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
822822
blockCommentStart: jsonMode ? null : "/*",
823823
blockCommentEnd: jsonMode ? null : "*/",
824+
blockCommentContinue: jsonMode ? null : " ",
824825
lineComment: jsonMode ? null : "//",
825826
fold: "brace",
826827
closeBrackets: "()[]{}''\"\"``",

0 commit comments

Comments
 (0)