Index: /CKEditor/trunk/_source/plugins/find/dialogs/find.js
===================================================================
--- /CKEditor/trunk/_source/plugins/find/dialogs/find.js	(revision 3733)
+++ /CKEditor/trunk/_source/plugins/find/dialogs/find.js	(revision 3734)
@@ -215,5 +215,4 @@
 			{
 				this._.isMatched = true;
-				this.highlight();
 			},
 
@@ -221,5 +220,4 @@
 			{
 				this._.isMatched = false;
-				this.removeHighlight();
 			},
 
@@ -428,5 +426,5 @@
 			searchRange : null,
 			matchRange : null,
-			find : function( pattern, matchCase, matchWord, matchCyclic )
+			find : function( pattern, matchCase, matchWord, matchCyclic, highlightMatched )
 			{
 				if( !this.matchRange )
@@ -472,6 +470,7 @@
 								continue;
 						}
-
 						this.matchRange.setMatched();
+						if ( highlightMatched !== false )
+							this.matchRange.highlight();
 						return true;
 					}
@@ -497,5 +496,5 @@
 
 			replace : function( dialog, pattern, newString, matchCase, matchWord,
-				matchCyclic, matchReplaceAll )
+				matchCyclic , isReplaceAll )
 			{
 				// Successiveness of current replace/find.
@@ -511,18 +510,21 @@
 					var domRange = this.matchRange.toDomRange();
 					var text = editor.document.createText( newString );
-
-					// Save undo snaps before and after the replacement.
-					var selection = editor.getSelection();
-					selection.selectRanges( [ domRange ] );
-					editor.fire( 'saveSnapshot' );
-
+					if ( !isReplaceAll )
+					{
+						// Save undo snaps before and after the replacement.
+						var selection = editor.getSelection();
+						selection.selectRanges( [ domRange ] );
+						editor.fire( 'saveSnapshot' );
+					}
 					domRange.deleteContents();
 					domRange.insertNode( text );
-
-					selection.selectRanges( [ domRange ] );
-					editor.fire( 'saveSnapshot' );
-
+					if ( !isReplaceAll )
+					{
+						selection.selectRanges( [ domRange ] );
+						editor.fire( 'saveSnapshot' );
+					}
 					this.matchRange.updateFromDomRange( domRange );
-					this.matchRange.highlight();
+					if ( !isReplaceAll )
+						this.matchRange.highlight();
 					this.matchRange._.isReplaced = true;
 					this.replaceCounter++;
@@ -530,12 +532,7 @@
 				}
 				else
-					result = this.find( pattern, matchCase, matchWord, matchCyclic );
-
-				// Recusively replace all matches.
-				if ( matchReplaceAll && result )
-					this.replace.apply( this, Array.prototype.slice.call( arguments ) );
-
-				return matchReplaceAll ?
-					this.replaceCounter : result;
+					result = this.find( pattern, matchCase, matchWord, matchCyclic, !isReplaceAll );
+
+				return result;
 			}
 		};
@@ -703,12 +700,23 @@
 										// Scope to full document.
 										finder.searchRange = getSearchRange( true );
-										finder.matchRange = null;
-										if ( ( replaceNums = finder.replace( dialog,
+										if ( finder.matchRange )
+										{
+											finder.matchRange.removeHighlight();
+											finder.matchRange = null;
+										}
+										editor.fire( 'saveSnapshot' );
+										while( finder.replace( dialog,
 											dialog.getValueOf( 'replace', 'txtFindReplace' ),
 											dialog.getValueOf( 'replace', 'txtReplace' ),
 											dialog.getValueOf( 'replace', 'txtReplaceCaseChk' ),
 											dialog.getValueOf( 'replace', 'txtReplaceWordChk' ),
-											false, true ) ) )
-											alert( editor.lang.findAndReplace.replaceSuccessMsg.replace( /%1/, replaceNums ) );
+											false, true ) )
+										;
+
+										if ( finder.replaceCounter )
+										{
+											alert( editor.lang.findAndReplace.replaceSuccessMsg.replace( /%1/, finder.replaceCounter ) );
+											editor.fire( 'saveSnapshot' );
+										}
 										else
 											alert( editor.lang.findAndReplace.notFoundMsg );
