aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Kishore2014-06-16 07:55:56 (EDT)
committerAbhishek Kishore2014-07-08 02:26:50 (EDT)
commitd7358b2f165914812f728ab511c4265cd97974a9 (patch)
tree6473eae365c0277ec9bba96473767254126de6cc
parent82d44d22e81fd3fdece0fbbe0f34c8fcecae0d76 (diff)
downloadeclipse.platform.swt-d7358b2f165914812f728ab511c4265cd97974a9.zip
eclipse.platform.swt-d7358b2f165914812f728ab511c4265cd97974a9.tar.gz
eclipse.platform.swt-d7358b2f165914812f728ab511c4265cd97974a9.tar.bz2
Bug 421246 - StyledText: incorrect caret move in first/last line (OS X)refs/changes/64/28564/4
Change-Id: Iac753a82d7f4b47e06e1812fb4b213c05f5ce008 Signed-off-by: Abhishek Kishore <abhishek.kishore@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java14
1 files changed, 6 insertions, 8 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 3a3ffcb..c38111f 100644
--- 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
@@ -2591,7 +2591,8 @@ void doDeleteWordPrevious() {
/**
* Moves the caret one line down and to the same character offset relative
* to the beginning of the line. Move the caret to the end of the new line
- * if the new line is shorter than the character offset.
+ * if the new line is shorter than the character offset. Moves the caret to
+ * the end of the text if the caret already is on the last line.
*/
void doLineDown(boolean select) {
int caretLine = getCaretLine();
@@ -2616,9 +2617,7 @@ void doLineDown(boolean select) {
caretLine++;
}
if (lastLine) {
- if (select) {
- setCaretOffset(content.getCharCount(), SWT.DEFAULT);
- }
+ setCaretOffset(content.getCharCount(), SWT.DEFAULT);
} else {
int[] alignment = new int[1];
int offset = getOffsetAtPoint(columnX, y, caretLine, alignment);
@@ -2677,7 +2676,8 @@ void doLineStart() {
/**
* Moves the caret one line up and to the same character offset relative
* to the beginning of the line. Move the caret to the end of the new line
- * if the new line is shorter than the character offset.
+ * if the new line is shorter than the character offset. Moves the caret to
+ * the beginning of the document if it is already on the first line.
*/
void doLineUp(boolean select) {
int caretLine = getCaretLine(), y = 0;
@@ -2702,9 +2702,7 @@ void doLineUp(boolean select) {
caretLine--;
}
if (firstLine) {
- if (select) {
- setCaretOffset(0, SWT.DEFAULT);
- }
+ setCaretOffset(0, SWT.DEFAULT);
} else {
int[] alignment = new int[1];
int offset = getOffsetAtPoint(columnX, y, caretLine, alignment);