产品-公式编辑器
This commit is contained in:
parent
6f0c1044ad
commit
5c56b8ced4
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue