Bug 370606 - Problems with UndoStack and deletions at the beginning of the document (comment#8)
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/textview/undoStack.js b/bundles/org.eclipse.orion.client.editor/web/orion/textview/undoStack.js
index c211d6a..a70eb55 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/textview/undoStack.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/textview/undoStack.js
@@ -349,8 +349,8 @@
 				return;
 			}
 			if (this._undoStart !== undefined && 
-				!((addedCharCount === 1 && removedCharCount === 0 && start === this._undoStart + this._undoText.length) ||
-					(addedCharCount === 0 && removedCharCount === 1 && (((start + 1) === this._undoStart) || (start === this._undoStart)))))
+				!((addedCharCount === 1 && removedCharCount === 0 && this._undoType === 1 && start === this._undoStart + this._undoText.length) ||
+					(addedCharCount === 0 && removedCharCount === 1 && this._undoType === -1 && (((start + 1) === this._undoStart) || (start === this._undoStart)))))
 			{
 				this._commitUndo();
 			}