Author: dpsimons
Date: Thu Jul  2 02:13:35 2015
New Revision: 38734

URL: http://svn.gna.org/viewcvs/gnustep?rev=38734&view=rev
Log:
fix a bug with _editedRange when first edit is a delete

Modified:
    libs/gui/branches/gnustep_testplant_branch/ChangeLog
    libs/gui/branches/gnustep_testplant_branch/Source/NSTextStorage.m

Modified: libs/gui/branches/gnustep_testplant_branch/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/ChangeLog?rev=38734&r1=38733&r2=38734&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/ChangeLog        (original)
+++ libs/gui/branches/gnustep_testplant_branch/ChangeLog        Thu Jul  2 
02:13:35 2015
@@ -1,3 +1,10 @@
+2015-07-01  Doug Simons <[email protected]>
+
+       * 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 <[email protected]>
 
        * Source/NSView.m: Add checks to cut out parts of _invalidRect

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTextStorage.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTextStorage.m?rev=38734&r1=38733&r2=38734&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTextStorage.m   
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTextStorage.m   Thu Jul 
 2 02:13:35 2015
@@ -146,21 +146,21 @@
   NSDebugLLog(@"NSText", @"edited:range:changeInLength: called");
 
   /*
+   * Extend edited range to encompass the latest edit.
+   */
+  if (_editedMask == 0)
+    {
+      _editedRange = old;              // First edit.
+    }
+  else
+    {
+      _editedRange = NSUnionRange (_editedRange, old);
+    }
+
+  /*
    * Add in any new flags for this edit.
    */
   _editedMask |= mask;
-
-  /*
-   * Extend edited range to encompass the latest edit.
-   */
-  if (_editedRange.length == 0)
-    {
-      _editedRange = old;              // First edit.
-    }
-  else
-    {
-      _editedRange = NSUnionRange (_editedRange, old);
-    }
 
   /*
    * If the number of characters has been increased or decreased -


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to