Eclipse在最后查看的位置重新打开文件 [英] Eclipse reopen file at last viewed position
问题描述
Eclipse总是从顶部打开一个文件.但是,我想在上次查看的位置打开它,因为可能要在该位置附近继续编辑(另请参见
Eclipse always opens a file from the top. However, I want to open it at the last viewed position because it is likely that I have to continue editing near this position (see also Locality of reference). Furthermore, it makes sense to continue navigation at this place because it is where I left and so I have this relatively fresh in my mind. Thus, it gives me orientation. Finding the last viewed position can be time consuming.
其他一些编辑器(例如Visual Studio Code)在打开文件时显示上次查看的位置.这个小小的变化对我帮助很大的帮助来浏览和编辑重新打开的文件中的代码.
Some other editors, e.g., Visual Studio Code show the last viewed position when opening a file. This little change helps me a lot to navigate and edit code in re-opened files.
是否有可能在Eclipse中获得相同的行为,即在上次查看的位置重新打开文件?
Is it possible to get the same behavior in Eclipse, i.e., re-open files at the last viewed position?
推荐答案
I added this feature to my plugin RecentEditors.
编辑器的当前滚动位置和插入位置保持不变,并且在重新打开编辑器时可以恢复.这样可以在最后查看的位置继续编辑.
The current scroll position and caret position of editors is persisted and can be restored when an editor is re-opened. This enables to continue editing at the last viewed position.
此外,该插件添加了一个新对话框,以查看并重新打开最近关闭的文件.
Furthermore, the plugin adds a new dialog to see and re-open recently closed files.
您可以在 Eclipse Marketplace 和 查看全文