Fix bug in EditSession.$updateInternalDataOnChange. Shifting the fold lines on deletion have to use end.row instead of lastRow, as lastRow is "normalized".

This commit is contained in:
Julian Viereck 2011-05-17 20:28:48 +02:00
commit 62f168eb8e

View file

@ -1010,7 +1010,7 @@ var EditSession = function(text, mode) {
removedFolds = this.getFoldsInRange(e.data.range);
this.removeFolds(removedFolds);
var foldLine = this.getFoldLine(lastRow);
var foldLine = this.getFoldLine(end.row);
var idx = 0;
if (foldLine) {
foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
@ -1026,7 +1026,7 @@ var EditSession = function(text, mode) {
for (idx; idx < foldLines.length; idx++) {
var foldLine = foldLines[idx];
if (foldLine.start.row >= lastRow) {
if (foldLine.start.row >= end.row) {
foldLine.shiftRow(-len);
}
}