diff options
author | Lynn Kues <lkues> | 2003-03-04 17:53:00 +0000 |
---|---|---|
committer | Lynn Kues <lkues> | 2003-03-04 17:53:00 +0000 |
commit | a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23 (patch) | |
tree | 9bfad638da02a10a9d38110b4e9c4a1205c205f3 /bundles | |
parent | 944b83a4bb46408d3311c2136f4f4ef96e4bbf96 (diff) | |
download | eclipse.platform.swt-a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23.tar.gz eclipse.platform.swt-a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23.tar.xz eclipse.platform.swt-a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23.zip |
29027
Diffstat (limited to 'bundles')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index 331d66201b..c629ce1054 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -2806,33 +2806,33 @@ void doDelete() { * Deletes the next word.
*/
void doDeleteWordNext() {
- Event event = new Event();
- event.text = "";
if (selection.x != selection.y) {
- event.start = selection.x;
- event.end = getWordEnd(selection.x);
- }
- else {
+ // if a selection exists, treat the as if
+ // only the delete key was pressed
+ doDelete();
+ } else {
+ Event event = new Event();
+ event.text = "";
event.start = caretOffset;
event.end = getWordEnd(caretOffset);
+ sendKeyEvent(event);
}
- sendKeyEvent(event);
}
/**
* Deletes the previous word.
*/
void doDeleteWordPrevious() {
- Event event = new Event();
- event.text = "";
if (selection.x != selection.y) {
- event.start = getWordStart(selection.y);
- event.end = selection.y;
- }
- else {
+ // if a selection exists, treat as if
+ // only the backspace key was pressed
+ doBackspace();
+ } else {
+ Event event = new Event();
+ event.text = "";
event.start = getWordStart(caretOffset);
event.end = caretOffset;
+ sendKeyEvent(event);
}
- sendKeyEvent(event);
}
/**
* Moves the caret one line down and to the same character offset relative
|