summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynn Kues <lkues>2003-03-04 17:53:00 +0000
committerLynn Kues <lkues>2003-03-04 17:53:00 +0000
commita80a9c18b87fdc30dc5882e6c7a896dbdfc71a23 (patch)
tree9bfad638da02a10a9d38110b4e9c4a1205c205f3
parent944b83a4bb46408d3311c2136f4f4ef96e4bbf96 (diff)
downloadeclipse.platform.swt-a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23.tar.gz
eclipse.platform.swt-a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23.tar.xz
eclipse.platform.swt-a80a9c18b87fdc30dc5882e6c7a896dbdfc71a23.zip
29027
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java28
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