Index: _source/plugins/find/dialogs/find.js
===================================================================
--- _source/plugins/find/dialogs/find.js	(revision 3564)
+++ _source/plugins/find/dialogs/find.js	Tue Jun 16 19:16:28 CST 2009
@@ -505,11 +505,24 @@
 				if ( this.matchRange && this.matchRange.isMatched()
 						&& !this.matchRange._.isReplaced )
 				{
+					// Turn off highlight for a while when saving snapshots.
+					this.matchRange.removeHighlight();
 					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' );
+
 					domRange.deleteContents();
 					domRange.insertNode( text );
+
+					selection.selectRanges( [ domRange ] );
+					editor.fire( 'saveSnapshot' );
+
 					this.matchRange.updateFromDomRange( domRange );
+					this.matchRange.highlight();
 					this.matchRange._.isReplaced = true;
 					this.replaceCounter++;
 					result = true;
@@ -648,7 +661,6 @@
 									onClick : function()
 									{
 										var dialog = this.getDialog();
-										editor.fire( 'saveSnapshot' );
 										if ( !finder.replace( dialog,
 													dialog.getValueOf( 'replace', 'txtFindReplace' ),
 													dialog.getValueOf( 'replace', 'txtReplace' ),
@@ -685,7 +697,6 @@
 										var dialog = this.getDialog();
 										var replaceNums;
 
-										editor.fire( 'saveSnapshot' );
 										finder.replaceCounter = 0;
 										if ( ( replaceNums = finder.replace( dialog,
 											dialog.getValueOf( 'replace', 'txtFindReplace' ),
