From 5c56b8ced42e7cfbb95fe2e612d0a346ee07730c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 28 Apr 2023 16:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=85=AC=E5=BC=8F=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/excelEditor/extendCodeMirror.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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