Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 299445

Summary: [GlobalActions] [navigation] org.eclipse.ui.edit.text.gotoLastEditPosition should support retargeting for non-text editors
Product: [Eclipse Project] Platform Reporter: Simon Pope <skjpope>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, ob1.eclipse, pwebster, saurav.sarkar1
Version: 3.5Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=32214
Whiteboard: stalebug

Description Simon Pope CLA 2010-01-12 18:55:45 EST
Build Identifier: I20091210-1301

The action, org.eclipse.ui.edit.text.gotoLastEditPosition, does not allow retargeting, and therefore does not work with non-text editors.

A reasonably simple partial solution would be to change the action to allow retargeting, and create a command handler that is active when the activeEditor is an instanceof AbstractTextEditor.

While not perfect, this would be a significant improvement on the current arrangement. This would allow other editors to define their own command handlers for when they are active.

Longer-term the set/get LastEditPosition should sit in a plugin other than TextEditorPlugin, and should be generic, allowing for different methods of specifying the last item edited. Currently it supports spans of text, but it should support any means of location (such as an ISelection).

Related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=32214

Reproducible: Always
Comment 1 Oleg Besedin CLA 2010-01-13 10:46:05 EST
The action is contributed by the Platform/Text so I'll forward this enahncement into that bucket.
Comment 2 Dani Megert CLA 2010-01-13 10:53:41 EST
Would adding
  retarget="true"
fix your problem for now?
Comment 3 Simon Pope CLA 2010-01-15 04:12:47 EST
Yes, that would be a marvelous quick fix.

Long term, it would be better to refactor to the newer handler/command pattern, but 'retarget=true' would be a great start!
Comment 4 Dani Megert CLA 2010-01-15 04:50:33 EST
Unfortunately we can't just add that attribute because it would break existing clients. They would have to jump on board and retarget the action which is a no go.

I'm moving the bug to Platform UI since the general solution is outside Platform Text.
Comment 5 saurav sarkar CLA 2013-03-27 03:41:42 EDT
Any chances for this to be done.
We would like to have this for our multipage editors which contains some form based editor tabs.

cheers,
Saurav
Comment 6 Dani Megert CLA 2013-03-27 03:47:09 EDT
(In reply to comment #5)
> Any chances for this to be done.
> We would like to have this for our multipage editors which contains some
> form based editor tabs.
> 
> cheers,
> Saurav

Only if someone provides a high quality patch.
Comment 7 Lars Vogel CLA 2019-11-27 07:38:13 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.