Eclipse:使用同一编辑器选项卡通过多次搜索打开的文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3243743/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:30:45  来源:igfitidea点击:

Eclipse: Files opened by multiple searches using same editor tab

eclipsesearch

提问by digiarnie

When using the "file search" function in eclipse to find a bit of text in a ".java" file, I may get a list of several search results. Let's say I double click on the file "A.java" which then opens A.java in a new editor tab. If I then use the "file search" function again to find some other bit of text and this time double click on the file "B.java", this file will replace "A.java" in the editor.

当在 eclipse 中使用“文件搜索”功能在“.java”文件中查找一些文本时,我可能会得到几个搜索结果的列表。假设我双击文件“A.java”,然后在新的编辑器选项卡中打开 A.java。如果我再次使用“文件搜索”功能来查找其他一些文本,并且这次双击文件“B.java”,该文件将替换编辑器中的“A.java”。

I'd like Eclipse to open a new editor for B.java so that both A.java and B.java are available in my editor tabs. Is this possible? I've had a look around in the preferences but I'm not sure what option would give me this bit of functionality.

我希望 Eclipse 为 B.java 打开一个新的编辑器,以便 A.java 和 B.java 在我的编辑器选项卡中都可用。这可能吗?我已经查看了首选项,但我不确定哪个选项会给我这种功能。

回答by Chris Lercher

Disable the option

禁用该选项

Preferences > General > Search > Reuse editors to show matches

首选项 > 常规 > 搜索 > 重复使用编辑器来显示匹配项

回答by prageeth

Above is the best answer. But since I don't always want to open the search result in a new tab I usually use something like this.

以上是最佳答案。但是由于我并不总是想在新选项卡中打开搜索结果,所以我通常使用这样的方法。

right click on the result -> Show In -> Package Explorer ->(file is now automatically selected)->Press 'Enter'

More simply

更简单

Select the result -> alt + shift + w -> Package Explorer -> press 'Enter' twice