Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 391351 - Editor scrolls to the top after opening a file
Summary: Editor scrolls to the top after opening a file
Status: CLOSED DUPLICATE of bug 375576
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-08 09:28 EDT by Daniel Gómez Ferro CLA
Modified: 2012-10-08 09:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Gómez Ferro CLA 2012-10-08 09:28:08 EDT
After opening a new file at a given location (using Open Declaration, for example) the view is focused on the relevant lines (e.g. 90-180) but the scrollbar is at the top. If I try to scroll the view suddenly jumps to where the scrollbar is and starts scrolling from there.

If the file is already open when using Open Declaration this doesn't happen, the scrollbar is where it should be.

Steps to reproduce:

A.java

public class A {
public static void a() {
B.b();
}
}

B.java
public class B {

<<many blank lines or code>>

public static void b() {       
}
}

1) A.java is open, B.java is closed
2) Ctrl+click in b(), opens B.java, the view is not at the top but the scrollbar is
3) Scroll with the mouse wheel, the view jumps to the top
4) If I retry with B.java opened from the beginning it works fine
Comment 1 Dani Megert CLA 2012-10-08 09:31:24 EDT
4.2.1 contains a workaround for that bug.

*** This bug has been marked as a duplicate of bug 375576 ***