Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 3845)
+++ /CKEditor/trunk/CHANGES.html	(revision 3846)
@@ -111,5 +111,6 @@
 		<li><a href="http://dev.fckeditor.net/ticket/3903">#3903</a> : Color button plugin doesn't read config entry from editor instance correctly.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/3801">#3801</a> : Comments at the start of the document was lost in IE.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/3879">#3879</a> : Color button panel was incorrect size on first open in webkit.</li>		
+		<li><a href="http://dev.fckeditor.net/ticket/3879">#3879</a> : Color button panel was incorrect size on first open in webkit.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/3871">#3871</a> : Unable to redo when undos to the front of snapshots stack.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/plugins/editingblock/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/editingblock/plugin.js	(revision 3845)
+++ /CKEditor/trunk/_source/plugins/editingblock/plugin.js	(revision 3846)
@@ -172,4 +172,5 @@
 			var currentMode = getMode( this );
 			data = currentMode.getData();
+			data = this.fire( 'beforeModeUnload', data );
 			currentMode.unload( holderElement );
 			this.mode = '';
Index: /CKEditor/trunk/_source/plugins/undo/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/undo/plugin.js	(revision 3845)
+++ /CKEditor/trunk/_source/plugins/undo/plugin.js	(revision 3846)
@@ -82,20 +82,15 @@
 			} );
 
+			// Always save an undo snapshot - the previous mode might have
+			// changed editor contents.
+			editor.on( 'beforeModeUnload', function()
+			{
+				editor.mode == 'wysiwyg' && undoManager.save( true );
+			} );
+
 			// Make the undo manager available only in wysiwyg mode.
 			editor.on( 'mode', function()
 				{
-					if ( editor.mode == 'wysiwyg' )
-					{
-						if ( !undoManager.enabled )
-						{
-							undoManager.enabled = true;
-							// Always save an undo snapshot - the previous mode might have changed
-							// editor contents.
-							undoManager.save( true );
-						}
-					}
-					else
-						undoManager.enabled = false;
-
+					undoManager.enabled = editor.mode == 'wysiwyg';
 					undoManager.onChange();
 				});
