Bug 412381

Summary: [open type] should not scroll the editor / set selection unless necessary
Product: [Eclipse Project] JDT Reporter: Ole Jørgen <olejorgenb>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Ole Jørgen CLA 2013-07-05 05:14:49 EDT
When a editor i already open for the chosen type it's very annoying that the editor position is moved/scrolled to the top/type name.

I understand why it's done like this (since a file can contain multiple types), but it would be nice if it only happened when necessary. 

- The file only contains one type -> not necessary
- The cursor is already inside the selected type -> not necessary (maybe a bit more debatable)

Since I work with different resource types with similar names (XXX.java, XXX.js, etc.) using "open resource" for everything isn't ideal. (typing *postfix doesn't quite cut it) This also makes "quick switch editor" not so useful. (in addition to that it's annoying when you don't have the editor open, and that it doesn't support initial matching)

Another person requesting this: http://www.eclipse.org/forums/index.php/t/295525/
Comment 1 Markus Keller CLA 2013-07-08 09:55:02 EDT
See also bug 49791. If we change this, then we should also think about doing the same when the user selects a type in views (Types, Package Explorer, Type Hierarchy).

> - The cursor is already inside the selected type -> not necessary (maybe a bit more debatable)

That's actually the solution I'd prefer, since it ensures that the selection always ends up inside the type (but not necessarily on the type name any more).