Ticket #3720: 3720.patch
File 3720.patch, 1.7 KB (added by , 15 years ago) |
---|
-
_source/plugins/find/dialogs/find.js
505 505 if ( this.matchRange && this.matchRange.isMatched() 506 506 && !this.matchRange._.isReplaced ) 507 507 { 508 // Turn off highlight for a while when saving snapshots. 509 this.matchRange.removeHighlight(); 508 510 var domRange = this.matchRange.toDomRange(); 509 511 var text = editor.document.createText( newString ); 512 513 // Save undo snaps before and after the replacement. 514 var selection = editor.getSelection(); 515 selection.selectRanges( [ domRange ] ); 516 editor.fire( 'saveSnapshot' ); 517 510 518 domRange.deleteContents(); 511 519 domRange.insertNode( text ); 520 521 selection.selectRanges( [ domRange ] ); 522 editor.fire( 'saveSnapshot' ); 523 512 524 this.matchRange.updateFromDomRange( domRange ); 525 this.matchRange.highlight(); 513 526 this.matchRange._.isReplaced = true; 514 527 this.replaceCounter++; 515 528 result = true; … … 648 661 onClick : function() 649 662 { 650 663 var dialog = this.getDialog(); 651 editor.fire( 'saveSnapshot' );652 664 if ( !finder.replace( dialog, 653 665 dialog.getValueOf( 'replace', 'txtFindReplace' ), 654 666 dialog.getValueOf( 'replace', 'txtReplace' ), … … 685 697 var dialog = this.getDialog(); 686 698 var replaceNums; 687 699 688 editor.fire( 'saveSnapshot' );689 700 finder.replaceCounter = 0; 690 701 if ( ( replaceNums = finder.replace( dialog, 691 702 dialog.getValueOf( 'replace', 'txtFindReplace' ),