Index: /FCKeditor/trunk/editor/_source/classes/fckdomrange_ie.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckdomrange_ie.js	(revision 732)
+++ /FCKeditor/trunk/editor/_source/classes/fckdomrange_ie.js	(revision 733)
@@ -34,13 +34,12 @@
 	if ( oSel.type != 'Control' )
 	{
-		var eMarkerStart = this._GetSelectionMarkerTag( true ) ;
-		var eMarkerEnd = this._GetSelectionMarkerTag( false ) ;
+		var eMarkerStart	= this._GetSelectionMarkerTag( true ) ;
+		var eMarkerEnd		= this._GetSelectionMarkerTag( false ) ;
 
-		if ( ! ( eMarkerStart && eMarkerEnd ) )
+		if ( !eMarkerStart && !eMarkerEnd )
 		{
-			this._Range.setStart( this.Window.document.body, 0 );
-			this._Range.collapse( true );
-			this._UpdateElementInfo();
-			return;
+			this._Range.setStart( this.Window.document.body, 0 ) ;
+			this._UpdateElementInfo() ;
+			return ;
 		}
 
@@ -76,5 +75,5 @@
 		// Create marker tags for the start and end boundaries.
 		var eStartMarker	= this._GetRangeMarkerTag( true ) ;
-		var bIsStartMakerAlone	= eStartMarker.previousSibling == null && eStartMarker.nextSibing == null ;
+		var bIsStartMakerAlone ;
 
 		if ( !bIsCollapsed )
@@ -100,4 +99,6 @@
 			oIERange.moveEnd( 'character', -1 ) ;
 		}
+		else
+			bIsStartMakerAlone = ( !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ;
 
 		// Remove the markers (reset the position, because of the changes in the DOM tree).
@@ -109,12 +110,23 @@
 			if ( bIsStartMakerAlone )
 			{
+				// The following trick is needed so IE makes collapsed selections
+				// inside empty blocks visible (expands the block).
+
 				try
 				{
 					oIERange.pasteHTML( '&nbsp;' ) ;
+					
+					// Move the selection start to include the &nbsp;.
 					oIERange.moveStart( 'character', -1 ) ;
 				}
-				catch ( e ) {}
-				oIERange.select() ;
-				oIERange.pasteHTML( '' ) ;
+				catch (e){}
+
+				// The following must be done into a separate try block. (#1034)
+				try
+				{	
+					oIERange.select() ;
+					this.Window.document.selection.clear() ;
+				}
+				catch (e){}
 			}
 			else
@@ -149,15 +161,16 @@
 	}
 
-	oRange.collapse( toStart === true ) ;
-
 	// IE might take the range object to the main window instead of inside the editor iframe window.
 	// This is known to happen when the editor window has not been selected before (See #933).
 	// We need to avoid that.
 	if ( oRange.parentElement().document != doc )
-		return null;
+		return null ;
+
+	oRange.collapse( toStart === true ) ;
 
 	// Paste a marker element at the collapsed range and get it from the DOM.
 	var sMarkerId = 'fck_dom_range_temp_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000) ;
 	oRange.pasteHTML( '<span id="' + sMarkerId + '"></span>' ) ;
+
 	return doc.getElementById( sMarkerId ) ;
 }
