开发者

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 - go开发者_如何学Cing 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.


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.


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).


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.

Eclipse IDE last edit location history - multiple steps back?

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.


You can use the local history if you lost your undo redo functions. to do that: 1/ right click anywhere on your code, 2/ Team, 3/ Show Local History, then choose the version you want according to edit time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜