This commit is contained in:
Fabian Jakobs 2011-08-12 09:35:11 +02:00
commit b8237e3f4b
6 changed files with 75 additions and 15 deletions

View file

@ -17683,7 +17683,7 @@ var Text = function(parentEl) {
var html = [];
var tokens = this.session.getTokens(i, i);
this.$renderLine(html, i, tokens[0].tokens, true);
this.$renderLine(html, i, tokens[0].tokens, !this.$useLineGroups());
lineElement = dom.setInnerHtml(lineElement, html.join(""));
i = this.session.getRowFoldEnd(i);
@ -17752,9 +17752,14 @@ var Text = function(parentEl) {
// don't use setInnerHtml since we are working with an empty DIV
container.innerHTML = html.join("");
var lines = container.childNodes
while(lines.length)
fragment.appendChild(lines[0]);
if (this.$useLineGroups()) {
container.className = 'ace_line_group';
fragment.appendChild(container);
} else {
var lines = container.childNodes
while(lines.length)
fragment.appendChild(lines[0]);
}
row++;
}
@ -17781,6 +17786,9 @@ var Text = function(parentEl) {
if(row > lastRow)
break;
if (this.$useLineGroups())
html.push("<div class='ace_line_group'>")
// Get the tokens per line as there might be some lines in between
// beeing folded.
// OPTIMIZE: If there is a long block of unfolded lines, just make
@ -17789,6 +17797,9 @@ var Text = function(parentEl) {
if (tokens.length == 1)
this.$renderLine(html, row, tokens[0].tokens, false);
if (this.$useLineGroups())
html.push("</div>"); // end the line group
row++;
}
this.element = dom.setInnerHtml(this.element, html.join(""));
@ -17998,6 +18009,15 @@ var Text = function(parentEl) {
var splits = this.session.$useWrapMode?this.session.$wrapData[row]:null;
this.$renderLineCore(stringBuilder, row, renderTokens, splits, onlyContents);
};
this.$useLineGroups = function() {
// For the updateLines function to work correctly, it's important that the
// child nodes of this.element correspond on a 1-to-1 basis to rows in the
// document (as distinct from lines on the screen). For sessions that are
// wrapped, this means we need to add a layer to the node hierarchy (tagged
// with the class name ace_line_group).
return this.session.getUseWrapMode();
};
this.destroy = function() {
clearInterval(this.$pollSizeChangesTimer);

File diff suppressed because one or more lines are too long

View file

@ -14484,7 +14484,7 @@ var Text = function(parentEl) {
var html = [];
var tokens = this.session.getTokens(i, i);
this.$renderLine(html, i, tokens[0].tokens, true);
this.$renderLine(html, i, tokens[0].tokens, !this.$useLineGroups());
lineElement = dom.setInnerHtml(lineElement, html.join(""));
i = this.session.getRowFoldEnd(i);
@ -14553,9 +14553,14 @@ var Text = function(parentEl) {
// don't use setInnerHtml since we are working with an empty DIV
container.innerHTML = html.join("");
var lines = container.childNodes
while(lines.length)
fragment.appendChild(lines[0]);
if (this.$useLineGroups()) {
container.className = 'ace_line_group';
fragment.appendChild(container);
} else {
var lines = container.childNodes
while(lines.length)
fragment.appendChild(lines[0]);
}
row++;
}
@ -14582,6 +14587,9 @@ var Text = function(parentEl) {
if(row > lastRow)
break;
if (this.$useLineGroups())
html.push("<div class='ace_line_group'>")
// Get the tokens per line as there might be some lines in between
// beeing folded.
// OPTIMIZE: If there is a long block of unfolded lines, just make
@ -14590,6 +14598,9 @@ var Text = function(parentEl) {
if (tokens.length == 1)
this.$renderLine(html, row, tokens[0].tokens, false);
if (this.$useLineGroups())
html.push("</div>"); // end the line group
row++;
}
this.element = dom.setInnerHtml(this.element, html.join(""));
@ -14799,6 +14810,15 @@ var Text = function(parentEl) {
var splits = this.session.$useWrapMode?this.session.$wrapData[row]:null;
this.$renderLineCore(stringBuilder, row, renderTokens, splits, onlyContents);
};
this.$useLineGroups = function() {
// For the updateLines function to work correctly, it's important that the
// child nodes of this.element correspond on a 1-to-1 basis to rows in the
// document (as distinct from lines on the screen). For sessions that are
// wrapped, this means we need to add a layer to the node hierarchy (tagged
// with the class name ace_line_group).
return this.session.getUseWrapMode();
};
this.destroy = function() {
clearInterval(this.$pollSizeChangesTimer);

File diff suppressed because one or more lines are too long

View file

@ -14473,7 +14473,7 @@ var Text = function(parentEl) {
var html = [];
var tokens = this.session.getTokens(i, i);
this.$renderLine(html, i, tokens[0].tokens, true);
this.$renderLine(html, i, tokens[0].tokens, !this.$useLineGroups());
lineElement = dom.setInnerHtml(lineElement, html.join(""));
i = this.session.getRowFoldEnd(i);
@ -14542,9 +14542,14 @@ var Text = function(parentEl) {
// don't use setInnerHtml since we are working with an empty DIV
container.innerHTML = html.join("");
var lines = container.childNodes
while(lines.length)
fragment.appendChild(lines[0]);
if (this.$useLineGroups()) {
container.className = 'ace_line_group';
fragment.appendChild(container);
} else {
var lines = container.childNodes
while(lines.length)
fragment.appendChild(lines[0]);
}
row++;
}
@ -14571,6 +14576,9 @@ var Text = function(parentEl) {
if(row > lastRow)
break;
if (this.$useLineGroups())
html.push("<div class='ace_line_group'>")
// Get the tokens per line as there might be some lines in between
// beeing folded.
// OPTIMIZE: If there is a long block of unfolded lines, just make
@ -14579,6 +14587,9 @@ var Text = function(parentEl) {
if (tokens.length == 1)
this.$renderLine(html, row, tokens[0].tokens, false);
if (this.$useLineGroups())
html.push("</div>"); // end the line group
row++;
}
this.element = dom.setInnerHtml(this.element, html.join(""));
@ -14788,6 +14799,15 @@ var Text = function(parentEl) {
var splits = this.session.$useWrapMode?this.session.$wrapData[row]:null;
this.$renderLineCore(stringBuilder, row, renderTokens, splits, onlyContents);
};
this.$useLineGroups = function() {
// For the updateLines function to work correctly, it's important that the
// child nodes of this.element correspond on a 1-to-1 basis to rows in the
// document (as distinct from lines on the screen). For sessions that are
// wrapped, this means we need to add a layer to the node hierarchy (tagged
// with the class name ace_line_group).
return this.session.getUseWrapMode();
};
this.destroy = function() {
clearInterval(this.$pollSizeChangesTimer);

File diff suppressed because one or more lines are too long