| Summary: | [console] scrollbar in empty console | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Grzegorz Grzybek <gr.grzybek> | ||||||||||
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> | ||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | daniel_megert, digulla, gr.grzybek, jpstotz | ||||||||||
| Version: | 3.2 | ||||||||||||
| Target Milestone: | 3.3 M3 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows XP | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Grzegorz Grzybek
Created attachment 39022 [details]
empty console as if non-empty
I've been unable to reproduce this. What build are you using? Can you attach a simple test case that demonstrates the behavior? hmm. I've seen this behavior since at least 3.2M2 or M3... Console always behaves the same - run or debugged program produces output, but every line of text added increases scrollbar about 2 or 3 lines (in scrollbar meaning, not actual lines, that may be selected). After clearing the console, the extra "scrollbar" lines remains... I'll try to use Spy++ to see what are console's properties. I use Windows XPSP2, IE7beta2. 3.2 RC7
Moving to Text for comment. Not sure if this is a Text issue or perhaps SWT. Behavior can be seen by debugging the following program.
* put a breakpoint on the first line, debug to the breakpoint
(a) resume through the loop
(b) place cursor at bottom of the console (last empty line)
(c) drag the console scroll bar as far down as it will go
(d) repeat steps a, b, c
(e) clear console output
* repeat steps a, b, c, d, e
* by iteration 9 (or so) I get a scroll bar in the console even though it is empty
Looking at our ConsoleDocumentAdapter it appears we are answering the correct number of lines, so I'm not sure why it's sizing wrong.
public class ConsoleOutput {
public static void main(String[] args) {
for (int j = 0; j < 20; j++) { // BREAKPOINT
for (int i = 0; i < 400; i++) {
System.out.println(i + " - abcdefghijklmnopqrstuvwxyz");
}
}
}
}
Works for me if I simply remove TextConsoleViewer.createDocumentAdapter() i.e. if I use the one from Platform text. NOTE: it's not just the scroll bar: with each iteration the console text are seems to grow by 2 lines at the end. This can also be seen if you press 'Resume' without clearing the console and simply scroll to the bottom. One quick bug I see is that you set the line count to 0 when there's no input - that's wrong: there's always at least the first line - see StyledTextContent for details. There seems to be an additional bug as well: see scenario I described in comment 5 which does not involve to clear the console. Created attachment 44547 [details]
patch
Created attachment 45037 [details]
revised patch
released patch to HEAD fixed in HEAD Verified. Created attachment 48950 [details]
scrollbar indicates more console content
I've checked this problem in Eclipse 3.3M1 (with WTP I200608260752-200608260752) and there still is the same problem with scrollbar in console view.
After few simple for loops, there seems to be more and more lines in console - after clearing the view, the scrollbar still indicates some contents.
I think the problem is still present in 3.3M1 (Windows XP SP2, Internet Explorer 7RC1). I think, that in Eclipse 3.3m3 it works correctly... *** Bug 166454 has been marked as a duplicate of this bug. *** *** Bug 171547 has been marked as a duplicate of this bug. *** |