Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2015-07-28 23:40:58 -0400
committerSarika Sinha2015-07-28 23:40:58 -0400
commita2d2250130e110cec18cebbd8110da0c1c9234c5 (patch)
tree8384b09668a2b4d882be653346ea13f437a40092 /org.eclipse.ui.console
parentc6d34ede49e8f6702c871cab7e4b2314d6dc2630 (diff)
downloadeclipse.platform.debug-a2d2250130e110cec18cebbd8110da0c1c9234c5.tar.gz
eclipse.platform.debug-a2d2250130e110cec18cebbd8110da0c1c9234c5.tar.xz
eclipse.platform.debug-a2d2250130e110cec18cebbd8110da0c1c9234c5.zip
Bug 473081 - Scroll locks enables on empty console
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java23
1 files changed, 20 insertions, 3 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 ca9581d3c..51b8ba4a0 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
@@ -233,9 +233,16 @@ 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 || e.detail == SWT.ARROW_UP || e.detail == SWT.PAGE_UP) {
+ if (e.detail == SWT.TOP || e.detail == SWT.HOME) {
// 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
@@ -256,8 +263,14 @@ 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.PAGE_UP || e.keyCode == SWT.HOME || e.keyCode == SWT.TOP || e.keyCode == SWT.ARROW_UP) {
+ if (e.keyCode == SWT.HOME || e.keyCode == SWT.TOP) {
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
@@ -275,7 +288,11 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
setScrollLock(false);
}
} else if (!userHoldsScrollLock.get()) {
- setScrollLock(true);
+ if (checkEndOfDocument()) {
+ setScrollLock(false);
+ } else {
+ setScrollLock(true);
+ }
}
}
});

Back to the top