diff options
author | Ricardo Bochnia | 2016-02-26 22:42:43 +0000 |
---|---|---|
committer | Ricardo Bochnia | 2016-02-26 22:42:43 +0000 |
commit | 071befd701b955f0ad6580c230caa269273b11d6 (patch) | |
tree | f9676dafe268072cf8433b345e8245b39d38fcee | |
parent | ad622c0c28518612a1666598475a1fda3165709f (diff) | |
download | eclipse.platform.debug-071befd701b955f0ad6580c230caa269273b11d6.tar.gz eclipse.platform.debug-071befd701b955f0ad6580c230caa269273b11d6.tar.xz eclipse.platform.debug-071befd701b955f0ad6580c230caa269273b11d6.zip |
Bug 473641 - [console] Auto scroll lock unlocks too early when scrollingY20160303-0800
down a long log
The bottom line index of the console was calculated incorrectly. Using
the partial bottom index is way more reliable. The patch also lowers the
delta so that the scroll lock is set earlier.
Change-Id: Ib79e19951cd30a894b0954f4195b904c41547248
Signed-off-by: Ricardo Bochnia <ricardo.richard.b@gmail.com>
-rw-r--r-- | org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java | 7 |
1 files changed, 3 insertions, 4 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 60a92be6f..a84496ad2 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 @@ -159,11 +159,10 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener private boolean checkEndOfDocument() { StyledText textWidget = getTextWidget(); if (textWidget != null && !textWidget.isDisposed()) { - int partialIndex = JFaceTextUtil.getPartialBottomIndex(textWidget); - int bottomLine = JFaceTextUtil.getLineIndex(textWidget, partialIndex); + int partialBottomIndex = JFaceTextUtil.getPartialBottomIndex(textWidget); int lineCount = textWidget.getLineCount(); - int delta = textWidget.getVerticalBar().getIncrement() * 2; - return lineCount - bottomLine < delta; + int delta = textWidget.getVerticalBar().getIncrement(); + return lineCount - partialBottomIndex < delta; } return false; } |