如何取消 Eclipse 中的搜索突出显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3545191/
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-19 15:02:06  来源:igfitidea点击:

How to cancel search highlight in Eclipse

eclipse

提问by fastcodejava

When I search something in Eclipse, the search items stay highlighted for some time. How do I remove this after I have found what I was looking for?

当我在 Eclipse 中搜索某些内容时,搜索项会保持突出显示一段时间。找到我要找的东西后,如何删除它?

回答by K Erlandsson

Remove your matches in the search view, that will remove the highlighting. I.e., click the button with the two X's in the search view.

在搜索视图中删除您的匹配项,这将删除突出显示。即,单击搜索视图中带有两个 X 的按钮。

If you cannot see that view, navigate to window -> show view -> Search

如果您看不到该视图,请导航到窗口 -> 显示视图 -> 搜索

回答by Andreas Dolk

AFIAK, the search result view has a toolbar button to clear the search results. This removes the highlighting in the editor.

AFIAK,搜索结果视图有一个工具栏按钮可以清除搜索结果。这将删除编辑器中的突出显示。

回答by andrzej.szmukala

An alternative way is to run a search that will yield no results. For example file search, containing text - leave this field empty, files - some stupid extension like ".qwe".

另一种方法是运行不会产生任何结果的搜索。例如文件搜索,包含文本 - 将此字段留空,文件 - 一些愚蠢的扩展名,如“.qwe”。

For people concerned that https://stackoverflow.com/a/3545215/6012102removes search results from history.

对于担心https://stackoverflow.com/a/3545215/6012102从历史记录中删除搜索结果的人。

Select the search from history, press "Run the current search again" (2 rotating arrows icon). This will run the search and you will get all the results back (this brings back the text highlight as well unfortunately).

从历史记录中选择搜索,按“再次运行当前搜索”(2 个旋转箭头图标)。这将运行搜索,您将获得所有结果(不幸的是,这也会带回文本突出显示)。

回答by AAA

Disable Preferences->General->Text Editors->Annotations->Search Results->Text as.

禁用首选项->常规->文本编辑器->注释->搜索结果->文本为。

回答by Noumenon

For a single instance, delete the line and undo it: Ctrl+DCtrl+Z. This is faster than the other answers, and worked when they failed (for some buggy JSP I had).

对于单个实例,删除该行并撤消它:Ctrl+DCtrl+Z。这比其他答案更快,并且在它们失败时起作用(对于我拥有的一些有问题的 JSP)。