Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java23
1 files changed, 3 insertions, 20 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
index a84496ad2..25728cdb0 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
@@ -232,16 +232,9 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
public void widgetSelected(SelectionEvent e) {
// scroll lock if vertical scroll bar dragged, OR selection on
// vertical bar used
- if (e.detail == SWT.TOP || e.detail == SWT.HOME) {
+ if (e.detail == SWT.TOP || e.detail == SWT.HOME || e.detail == SWT.ARROW_UP || e.detail == SWT.PAGE_UP) {
// selecting TOP or HOME should lock
setScrollLock(true);
- } else if (e.detail == SWT.ARROW_UP || e.detail == SWT.PAGE_UP) {
- // selecting TOP or HOME should lock if not end of document
- if (checkEndOfDocument()) {
- setScrollLock(false);
- } else {
- setScrollLock(true);
- }
} else if (e.detail == SWT.END || e.detail == SWT.BOTTOM) {
// selecting BOTTOM or END from vertical scroll makes it
// reveal the end
@@ -262,14 +255,8 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
@Override
public void keyPressed(KeyEvent e) {
// lock the scroll if PAGE_UP ,HOME or TOP selected
- if (e.keyCode == SWT.HOME || e.keyCode == SWT.TOP) {
+ if (e.keyCode == SWT.PAGE_UP || e.keyCode == SWT.HOME || e.keyCode == SWT.TOP || e.keyCode == SWT.ARROW_UP) {
setScrollLock(true);
- } else if (e.keyCode == SWT.PAGE_UP || e.keyCode == SWT.ARROW_UP) {
- if (checkEndOfDocument()) {
- setScrollLock(false);
- } else {
- setScrollLock(true);
- }
} else if (e.keyCode == SWT.END || e.keyCode == SWT.BOTTOM) {
setScrollLock(false);// selecting END makes it reveal the
// end
@@ -287,11 +274,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
setScrollLock(false);
}
} else if (!userHoldsScrollLock.get()) {
- if (checkEndOfDocument()) {
- setScrollLock(false);
- } else {
- setScrollLock(true);
- }
+ setScrollLock(true);
}
}
});

Back to the top