[brailleblaster] push by brandon....@xxxxxxxxx - Fixed undo edit cut bug on 2015-02-05 14:37 GMT

  • From: brailleblaster@xxxxxxxxxxxxxx
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Thu, 05 Feb 2015 14:37:58 +0000

Revision: 3f3e6c7c982f
Branch:   rt1447-MergeElements
Author:   Brandon Roller<brandon.r.roller@xxxxxxxxx>
Date:     Thu Feb  5 14:41:41 2015 UTC
Log:      Fixed undo edit cut bug
https://code.google.com/p/brailleblaster/source/detail?r=3f3e6c7c982f

Modified:
/src/main/org/brailleblaster/perspectives/braille/views/wp/formatters/EditRecorder.java

=======================================
--- /src/main/org/brailleblaster/perspectives/braille/views/wp/formatters/EditRecorder.java Wed Feb 4 19:07:36 2015 UTC +++ /src/main/org/brailleblaster/perspectives/braille/views/wp/formatters/EditRecorder.java Thu Feb 5 14:41:41 2015 UTC
@@ -61,12 +61,17 @@
                int offset = e.start - lineStart;
                String lineText = currentLine;
                int index = offset;
- while(index < lineText.length() && (lineText.charAt(index) != ' ' || index < (offset + e.replacedText.length())))
-                       index++;
+               if(e.replacedText.length() == 0){
+                       while(index < lineText.length() && 
(lineText.charAt(index) != ' '))
+                               index++;
+               }
+               else {
+                       index = offset + e.replacedText.length();
+               }

                int wordEnd = index;
                index = offset;
-               while(index > 0 && lineText.charAt(index) != ' ')
+               while(index - 1 >= 0 && lineText.charAt(index - 1) != ' ')
                        index--;

                int wordStart = index;

Other related posts:

  • » [brailleblaster] push by brandon....@xxxxxxxxx - Fixed undo edit cut bug on 2015-02-05 14:37 GMT - brailleblaster