Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2015-04-15 01:39:44 -0400
committerSarika Sinha2015-04-15 01:39:44 -0400
commitd8ab8f362c6572602b90c79635cb77a113b64d0c (patch)
tree08f17394ba167912c50d3382daf93bd775b809dc /org.eclipse.ui.console
parentfb583bc76c41e7bc31536936af8ff34f0b170681 (diff)
downloadeclipse.platform.debug-d8ab8f362c6572602b90c79635cb77a113b64d0c.tar.gz
eclipse.platform.debug-d8ab8f362c6572602b90c79635cb77a113b64d0c.tar.xz
eclipse.platform.debug-d8ab8f362c6572602b90c79635cb77a113b64d0c.zip
Bug 457969 - [console] Automatic scroll lock should unlock when user
enters characters Change-Id: Ia35716db2a8635e0e1f0f2d9df0f942f61c222b9
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java12
1 files changed, 12 insertions, 0 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 504f0ce0a..1a0ab5bc9 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
@@ -31,6 +31,8 @@ import org.eclipse.swt.events.MouseTrackListener;
import org.eclipse.swt.events.MouseWheelListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Font;
@@ -149,6 +151,9 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
private void setScrollLock(boolean lock) {
userHoldsScrollLock.set(lock);
if (scrollLockStateProvider != null && scrollLockStateProvider.getAutoScrollLock() != lock) {
+ if (!lock && scrollLockStateProvider.getScrollLock()) {
+ return;
+ }
scrollLockStateProvider.setAutoScrollLock(lock);
}
}
@@ -278,6 +283,13 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
}
});
+ styledText.addVerifyListener(new VerifyListener() {
+ @Override
+ public void verifyText(VerifyEvent e) {
+ // unlock the auto lock is user starts typing
+ setScrollLock(false);
+ }
+ });
ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
propertyChangeListener = new HyperlinkColorChangeListener();
colorRegistry.addListener(propertyChangeListener);

Back to the top