Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 6458)
+++ /CKEditor/trunk/CHANGES.html	(revision 6459)
@@ -65,4 +65,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/4475">#4475</a> : Protected source in attributes and inline CSS text are not handled.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6984">#6984</a> : [FF] Tailing line breaks are lost in enter mode BR.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6987">#6987</a> : [IE] Text selection lost when calling editor::insertHtml from dialog in some situation.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/7124">#7124</a> : Czech;</li>
Index: /CKEditor/trunk/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 6458)
+++ /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 6459)
@@ -135,8 +135,5 @@
 								if ( savedRange )
 								{
-									// Range restored here might invalidate the DOM structure thus break up
-									// the locked selection, give it up. (#6083)
-									var lockedSelection = doc.getCustomData( 'cke_locked_selection' );
-									if ( restoreEnabled && !lockedSelection )
+									if ( restoreEnabled )
 									{
 										// Well not break because of this.
@@ -147,4 +144,12 @@
 										catch (e)
 										{}
+
+										// Update locked selection because of the normalized text nodes. (#6083, #6987)
+										var lockedSelection = doc.getCustomData( 'cke_locked_selection' );
+										if ( lockedSelection )
+										{
+											lockedSelection.unlock();
+											lockedSelection.lock();
+										}
 									}
 
