Ticket #5191: 5191.patch

File 5191.patch, 1.4 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/undo/plugin.js

     
    343343                /**
    344344                 * Save a snapshot of document image for later retrieve.
    345345                 */
    346                 save : function( onContentOnly, image, autoFireChange )
     346                save : function( onContentOnly, image, autoFireChange, forRedo )
    347347                {
    348                         var snapshots = this.snapshots;
     348                        var snapshots = this.snapshots,
     349                                nextImage;
    349350
    350351                        // Get a content image.
    351352                        if ( !image )
     
    359360                        if ( this.currentImage && image.equals( this.currentImage, onContentOnly ) )
    360361                                return false;
    361362
     363                        // If we are saving for a redo, the current code might have been automatically adjusted
     364                        // but the stored image doesn't reflect that in the currentImage, but on the next one. #5191
     365                        if ( !!forRedo && ((nextImage = this.getNextImage( false )) && image.equals( nextImage, onContentOnly )))
     366                                return false;
     367
    362368                        // Drop future snapshots.
    363369                        snapshots.splice( this.index + 1, snapshots.length - this.index - 1 );
    364370
     
    485491                        {
    486492                                // Try to save. If no changes have been made, the redo stack
    487493                                // will not change, so it will still be redoable.
    488                                 this.save( true );
     494                                this.save( true, null, false, true );
    489495
    490496                                // If instead we had changes, we can't redo anymore.
    491497                                if ( this.redoable() )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy