Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 150907 - [WorkbenchParts] New editor opened from existing one should be positioned at the same point
Summary: [WorkbenchParts] New editor opened from existing one should be positioned at ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 44295
Blocks:
  Show dependency tree
 
Reported: 2006-07-18 04:55 EDT by Max Gilead CLA
Modified: 2007-06-22 14:43 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Gilead CLA 2006-07-18 04:55:53 EDT
New editor opened from existing one (RMB click on editor tab) should be positioned at the same point as the parent editor. Now it's necessary to remember the line being edited and first thing to do after opening new editor is Ctrl+L and jump to the same line.
Comment 1 Paul Webster CLA 2006-07-28 08:58:56 EDT
Is this something that the text editor could check for when it gets the IDocument for an IEditorInput?

Is there some workbench support that is needed?

PW
Comment 2 Tom Hofmann CLA 2006-07-28 09:21:11 EDT
hm, IMO this makes sense for all kinds of editors, not just text - couldn't UI ask the parent editor for its selection and set it on the newly opened one?

ISelection sel= parent.getSelectionProvider().getSelection();
newEditor.getSelectionProvider().setSelection(sel);

I cannot find it, but wasn't there a discussion once about being able to open an editor with an initial selection?

Keeping the bug here until we decide where it belongs.
Comment 3 Dani Megert CLA 2006-07-31 06:20:19 EDT
>hm, IMO this makes sense for all kinds of editors, not just text 
Agree. The 'New Editor' action should decided whether to restore the selection and if so, do it for all editors not just text.

>I cannot find it, but wasn't there a discussion once about being able to open
>an editor with an initial selection?
The discussion was related to restoring the selection when restarting the workbench (see bug 124615 and its blocking bug).
Comment 4 Paul Webster CLA 2006-09-28 15:18:06 EDT
Is this still a problem in 3.3?

PW
Comment 5 Max Gilead CLA 2006-09-29 02:28:49 EDT
It is, at least in 3.3M2.
Comment 6 Paul Webster CLA 2007-06-22 14:43:30 EDT
This was fixed as part of bug 124615

PW