|
|
@ -13,6 +13,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
lineHeight: 2, |
|
|
|
lineHeight: 2, |
|
|
|
readOnly: false, |
|
|
|
readOnly: false, |
|
|
|
lineNumbers: false, |
|
|
|
lineNumbers: false, |
|
|
|
|
|
|
|
paramMatch: true, // 用来判断是否需要在代码中匹配参数,默认为true, R语言是不需要匹配参数
|
|
|
|
// 参数显示值构造函数
|
|
|
|
// 参数显示值构造函数
|
|
|
|
paramFormatter: function (v) { |
|
|
|
paramFormatter: function (v) { |
|
|
|
return v; |
|
|
|
return v; |
|
|
@ -25,9 +26,9 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
var conf = { |
|
|
|
var conf = { |
|
|
|
textWrapping: true, |
|
|
|
textWrapping: true, |
|
|
|
lineWrapping: true, |
|
|
|
lineWrapping: true, |
|
|
|
lineNumbers: false, |
|
|
|
lineNumbers: o.lineNumbers, |
|
|
|
readOnly: o.readOnly, |
|
|
|
readOnly: o.readOnly, |
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug
|
|
|
|
// 解决插入字段由括号或其他特殊字符包围时分裂的bug
|
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
}; |
|
|
|
}; |
|
|
|
o.readOnly && (conf.cursorBlinkRate = -1); |
|
|
|
o.readOnly && (conf.cursorBlinkRate = -1); |
|
|
@ -166,9 +167,10 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
var self = this, result; |
|
|
|
var self = this, o = this.options, result; |
|
|
|
this.refresh(); |
|
|
|
this.refresh(); |
|
|
|
self.editor.setValue(""); |
|
|
|
self.editor.setValue(""); |
|
|
|
|
|
|
|
if(o.paramMatch) { |
|
|
|
result = this._analyzeContent(v || ""); |
|
|
|
result = this._analyzeContent(v || ""); |
|
|
|
BI.each(result, function (i, item) { |
|
|
|
BI.each(result, function (i, item) { |
|
|
|
var fieldRegx = /\$[\{][^\}]*[\}]/; |
|
|
|
var fieldRegx = /\$[\{][^\}]*[\}]/; |
|
|
@ -179,6 +181,9 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
self.insertString(item); |
|
|
|
self.insertString(item); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
self.editor.setValue(v); |
|
|
|
|
|
|
|
} |
|
|
|
this._checkWaterMark(); |
|
|
|
this._checkWaterMark(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|