fix undo bug when inserting more than one line

This commit is contained in:
Fabian Jakobs 2010-10-20 11:12:50 +02:00
commit b6c2dace95

View file

@ -430,10 +430,10 @@ var Document = function(text, mode) {
var lastLine = newLines[newLines.length - 1] + line.substring(position.column);
this.lines[position.row] = firstLine;
this.$insertLines(position.row + 1, [lastLine], fromUndo);
this.$insertLines(position.row + 1, [lastLine], true);
if (newLines.length > 2) {
this.$insertLines(position.row + 1, newLines.slice(1, -1), fromUndo);
this.$insertLines(position.row + 1, newLines.slice(1, -1), true);
}
var end = {
@ -443,7 +443,6 @@ var Document = function(text, mode) {
}
if (!fromUndo && this.$undoManager) {
var nl = this.$getNewLineCharacter();
this.$deltas.push({
action: "insertText",
range: Range.fromPoints(position, end),