From 7edd6191bbd0601f59296230bd41fac904cf40a2 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Fri, 24 Jul 2015 13:58:58 +0000 Subject: [PATCH] 2015-07-24 Fred Kiefer * 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 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38836 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ Source/NSTextStorage.m | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 123d799ea..4929b1d94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-07-24 Fred Kiefer + + * 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 + 2015-06-28 Germán Arias * Resources/Spanish.lproj/Localizable.strings: Add translations. diff --git a/Source/NSTextStorage.m b/Source/NSTextStorage.m index e4401f3e7..3101c4c7f 100644 --- a/Source/NSTextStorage.m +++ b/Source/NSTextStorage.m @@ -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.