From b6c2dace95c5e3c859a071a268dca54780398361 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 20 Oct 2010 11:12:50 +0200 Subject: [PATCH] fix undo bug when inserting more than one line --- src/ace/Document.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ace/Document.js b/src/ace/Document.js index 2bb17c99..e064c24f 100644 --- a/src/ace/Document.js +++ b/src/ace/Document.js @@ -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),