2015-07-24 Fred Kiefer <FredKiefer@gmx.de>

* Source/NSTextStorage.m: Fixed a bug with setting _editedRange
        for multiple edits when the first one is a delete (which results in
        _editedRange having a length of 0) so it gets replaced instead
        of expanded to include all edits.
        Patch by Doug Simons <doug.simons@testplant.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38836 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2015-07-24 13:58:58 +00:00
parent 5e2eebece5
commit e67303d25d
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2015-07-24 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTextStorage.m: Fixed a bug with setting _editedRange for
multiple edits when the first one is a delete (which results in
_editedRange having a length of 0) so it gets replaced instead of
expanded to include all edits.
Patch by Doug Simons <doug.simons@testplant.com>
2015-06-28 Germán Arias <germanandre@gmx.es>
* Resources/Spanish.lproj/Localizable.strings: Add translations.

View file

@ -145,15 +145,10 @@ static NSNotificationCenter *nc = nil;
NSDebugLLog(@"NSText", @"edited:range:changeInLength: called");
/*
* Add in any new flags for this edit.
*/
_editedMask |= mask;
/*
* Extend edited range to encompass the latest edit.
*/
if (_editedRange.length == 0)
if (_editedMask == 0)
{
_editedRange = old; // First edit.
}
@ -162,6 +157,11 @@ static NSNotificationCenter *nc = nil;
_editedRange = NSUnionRange (_editedRange, old);
}
/*
* Add in any new flags for this edit.
*/
_editedMask |= mask;
/*
* If the number of characters has been increased or decreased -
* adjust the delta accordingly.