Don't access private $lines array of the document.

There are document implementations, which don't have this.
This commit is contained in:
Fabian Jakobs 2011-05-20 15:23:20 +02:00
commit 51d2a348c7

View file

@ -317,7 +317,7 @@ function Folding() {
throw "A fold can't end inside of an already existing fold";
}
if (endRow >= this.doc.$lines.length) {
if (endRow >= this.doc.getLength()) {
throw "End of fold is outside of the document.";
}
@ -493,7 +493,7 @@ function Folding() {
// Build the textline using the FoldLine walker.
var line = "";
var lines = this.doc.$lines;
var doc = this.doc;
var textLine = "";
foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) {
@ -508,7 +508,7 @@ function Folding() {
if (placeholder) {
textLine += placeholder;
} else {
textLine += lines[row].substring(lastColumn, column);
textLine += doc.getLine(row).substring(lastColumn, column);
}
}.bind(this), endRow, endColumn);
return textLine;
@ -519,7 +519,7 @@ function Folding() {
if (!foldLine) {
var line;
line = this.doc.$lines[row];
line = this.doc.getLine(row);
return line.substring(startColumn || 0, endColumn || line.length);
} else {
return this.getFoldDisplayLine(