Bug 412381 - [open type] should not scroll the editor / set selection unless necessary
Summary: [open type] should not scroll the editor / set selection unless necessary
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-05 05:14 EDT by Ole Jørgen CLA
Modified: 2013-07-08 09:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).