Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse IDE last edit location history - multiple steps back?

I'm now in a process of transition from Netbeans to Eclipse (Indigo).

Ctr+Q seems to have the same function - going back to the last edit location. But in Netbeans I was able to press Ctr+Q repeatedly and go further back without the need of altering the file content (undo and redo hack).

Is there such functionality in Eclipse?

Some info:

I'm using the JavaScript Development Toolkit, PDT, and YAML editor.

like image 999
antitoxic Avatar asked Jul 27 '11 14:07

antitoxic


3 Answers

9 years later, check out Eclipse 4.17 (2020_09)

Multiple Last Edit Locations

Previous Edit Location navigation (formerly named Last Edit Location) is now expanded to remember multiple edit locations.
The last 15 edit locations are now remembered.

For convenience, similar edit locations in close proximity to each other are also merged so that each of the 15 remembered locations remains distinct.

new menu item: Previous Edit Location

How to use

Two new keyboard shortcuts are introduced:

  • Ctrl+Alt+LEFT_ARROW (or on Mac Ctrl+Opt+LEFT_ARROW) navigates to the most recent edit location, just as Ctrl+Q always has in prior releases.
    However, now continuing to hold Ctrl+Alt and then pressing LEFT_ARROW again begins a traversal through the history of prior edit locations, with each additional press of LEFT_ARROW moving a step further back in history.
    Once traversal stops, future Ctrl+Alt+LEFT_ARROW actions are now temporarily anchored to this older historical location for easy exploration of that code region.

The classic Ctrl+Q mapping has been likewise enhanced with this new functionality, so that Ctrl+Q and Ctrl+Alt+LEFT_ARROW are synonymous.

  • Ctrl+Alt+RIGHT_ARROW (or on Mac Ctrl+Opt+RIGHT_ARROW) conversely moves the anchor forward through edit history, so after traversing backward with Ctrl+Alt+LEFT_ARROW, you can go forward again by holding Ctrl+Alt and repeatedly pressing RIGHT_ARROW.
    A new menu item has likewise been added for this forward navigation as well.

New edit locations are always inserted at the end, so original historical ordering is always maintained.
New edits also reset the last location "anchor" back to the most recent edit, so that pressing Ctrl+Alt+LEFT_ARROW once again brings you to the most recent edit rather than a historical one.

like image 80
VonC Avatar answered Oct 30 '22 23:10

VonC


It seems that Back action (Alt+Left) is more or less the same. The difference is that it tracks any action, not only edits. Actions as "Go to declarations" are also included in the history of Alt+Left.

I think, in a way, it's more useful because I track back my real actions as in "real browsing" the code. Though I will switch the keyboard shortcuts for Last Edit and Previous Action so that I keep the Ctr+Q habit.

like image 27
antitoxic Avatar answered Oct 31 '22 00:10

antitoxic


It is currently not possible in Eclipse. There is an old feature request for this functionality with Bugzilla id 72773 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=72773).

like image 1
K Erlandsson Avatar answered Oct 30 '22 23:10

K Erlandsson