optimize text rendering
This commit is contained in:
parent
cc3cdc02d1
commit
38bc918e81
1 changed files with 7 additions and 1 deletions
|
|
@ -132,6 +132,12 @@ ace.layer.Text = function(parentEl) {
|
|||
this.element.innerHTML = html.join("");
|
||||
};
|
||||
|
||||
this.$textToken = {
|
||||
"text": true,
|
||||
"rparen": true,
|
||||
"lparen": true
|
||||
};
|
||||
|
||||
this.renderLine = function(stringBuilder, row) {
|
||||
var tokens = this.tokenizer.getTokens(row);
|
||||
|
||||
|
|
@ -157,7 +163,7 @@ ace.layer.Text = function(parentEl) {
|
|||
.replace(spaceRe, spaceReplace)
|
||||
.replace(/\t/g, this.$tabString);
|
||||
|
||||
if (token.type !== "text") {
|
||||
if (!this.$textToken[token.type]) {
|
||||
stringBuilder.push("<span class='ace_", token.type, "'>", output, "</span>");
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue