From 51d2a348c7ae9d0e57ba6da492c75ad2d7f45cdc Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 20 May 2011 15:23:20 +0200 Subject: [PATCH] Don't access private $lines array of the document. There are document implementations, which don't have this. --- lib/ace/edit_session/folding.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ace/edit_session/folding.js b/lib/ace/edit_session/folding.js index 3a2e6121..d03de3f6 100644 --- a/lib/ace/edit_session/folding.js +++ b/lib/ace/edit_session/folding.js @@ -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(