fix a bug with _editedRange when first edit is a delete

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38734 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2015-07-02 00:13:35 +00:00
parent e8717e9f70
commit cc2e5f567f
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2015-07-01 Doug Simons <doug.simons@testplant.com>
* 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.
2015-06-17 Paul Landers <paul.landers@testplant.com>
* Source/NSView.m: Add checks to cut out parts of _invalidRect

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.