|
|
@ -19045,6 +19045,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
lineWrapping: true, |
|
|
|
lineWrapping: true, |
|
|
|
lineNumbers: false, |
|
|
|
lineNumbers: false, |
|
|
|
readOnly: o.readOnly, |
|
|
|
readOnly: o.readOnly, |
|
|
|
|
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug
|
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
}); |
|
|
|
}); |
|
|
|
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); |
|
|
|
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); |
|
|
@ -19130,6 +19131,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
var value = param; |
|
|
|
var value = param; |
|
|
|
param = this.options.paramFormatter(param); |
|
|
|
param = this.options.paramFormatter(param); |
|
|
|
var from = this.editor.getCursor(); |
|
|
|
var from = this.editor.getCursor(); |
|
|
|
|
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
|
|
|
|
this.editor.replaceSelection('\u200b' + param + '\u200b'); |
|
|
|
this.editor.replaceSelection('\u200b' + param + '\u200b'); |
|
|
|
var to = this.editor.getCursor(); |
|
|
|
var to = this.editor.getCursor(); |
|
|
|
var options = {className: 'param', atomic: true}; |
|
|
|
var options = {className: 'param', atomic: true}; |
|
|
@ -19150,7 +19152,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
return this.editor.getValue("\n", function (line) { |
|
|
|
return this.editor.getValue("\n", function (line) { |
|
|
|
var rawText = line.text, value = line.text, num = 0; |
|
|
|
var rawText = line.text, value = line.text, num = 0; |
|
|
|
value.text = rawText; |
|
|
|
value.text = rawText; |
|
|
|
_.forEach(line.markedSpans, function (i, ms) { |
|
|
|
//根据插入位置不同,line.markedSpan可能是乱序的
|
|
|
|
|
|
|
|
_.forEach(_.sortBy(line.markedSpans, "from"), function (i, ms) { |
|
|
|
switch (i.marker.className) { |
|
|
|
switch (i.marker.className) { |
|
|
|
case "param": |
|
|
|
case "param": |
|
|
|
case "error-param": |
|
|
|
case "error-param": |
|
|
|