ecere:gui:EditBox: undo ctrl+del word in a single step instead of char by char.
authorRejean Loyer <rejean.loyer@gmail.com>
Sun, 12 Feb 2012 07:30:03 +0000 (14:30 +0700)
committerJerome St-Louis <jerome@ecere.com>
Sun, 12 Feb 2012 07:30:37 +0000 (14:30 +0700)
ecere/src/gui/controls/EditBox.ec

index b46be4e..efab912 100644 (file)
@@ -3486,13 +3486,10 @@ private:
                   {
                      int i;
                      int length;
-                     //Can't delete right away as that would change the line.count
                      for(i = this.x; i < this.line.count; i++)
                      {
                         if(!IS_ALUNDER(this.line.buffer[i]))
                            break;
-                        DelCh(this.line, this.y, this.x, this.line, this.y, this.x+1, false);
-                        i--;
                      }
                      
                      for(; i < this.line.count; i++)
@@ -3500,9 +3497,8 @@ private:
                         //Delete trailing whitespace
                         if(IS_ALUNDER(this.line.buffer[i]))
                            break;
-                        DelCh(this.line, this.y, this.x, this.line, this.y, this.x+1, false);
-                        i--;
                      }
+                     DelCh(this.line, this.y, this.x, this.line, this.y, i, false);
                      SetViewToCursor(true);
                      Modified();
                   }