diff --git a/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js b/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js index e1b34b44..e70c6967 100644 --- a/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js +++ b/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js @@ -11,8 +11,8 @@ CodeMirror.extendMode("css", { }); CodeMirror.extendMode("javascript", { - commentStart: "/*", - commentEnd: "*/", + commentStart: "", + commentEnd: "", // FIXME semicolons inside of for newlineAfterToken: function (type, content, textAfter, state) { if (this.jsonMode) { @@ -37,10 +37,8 @@ CodeMirror.defineExtension("commentRange", function (isComment, from, to) { var cm = this, curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(from).state).mode; cm.operation(function () { if (isComment) { // Comment range - cm.replaceRange("", to); - // cm.replaceRange(curMode.commentEnd, to); - cm.replaceRange("", from); - // cm.replaceRange(curMode.commentStart, from); + cm.replaceRange(curMode.commentEnd, to); + cm.replaceRange(curMode.commentStart, from); if (from.line == to.line && from.ch == to.ch) // An empty comment inserted - put cursor inside cm.setCursor(from.line, from.ch + curMode.commentStart.length); } else { // Uncomment range