Ticket #4951: 4951.patch

File 4951.patch, 1.0 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/find/dialogs/find.js

     
    310310                        getNextCharacterRange : function( maxLength )
    311311                        {
    312312                                var lastCursor,
     313                                                nextRangeWalker,
    313314                                                cursors = this._.cursors;
    314                                 if ( !( lastCursor = cursors[ cursors.length - 1 ] ) )
    315                                         return null;
    316                                 return new characterRange(
    317                                                                                 new characterWalker(
    318                                                                                         getRangeAfterCursor( lastCursor ) ),
    319                                                                                 maxLength );
     315
     316                                if ( ( lastCursor = cursors[ cursors.length - 1 ] ) )
     317                                        nextRangeWalker = new characterWalker( getRangeAfterCursor( lastCursor ) );
     318                                // In case it's an empty range (no cursors), figure out next range from walker (#4951).
     319                                else
     320                                        nextRangeWalker = this._.walker;
     321
     322                                return new characterRange( nextRangeWalker, maxLength );
    320323                        },
    321324
    322325                        getCursors : function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy