How to cancel search highlight in Eclipse
EclipseEclipse Problem Overview
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 Solutions
Solution 1 - Eclipse
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.
If you cannot see that view, navigate to window -> show view -> Search
Solution 2 - Eclipse
AFIAK, the search result view has a toolbar button to clear the search results. This removes the highlighting in the editor.
Solution 3 - Eclipse
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".
For people concerned that https://stackoverflow.com/a/3545215/6012102 removes search results from history.
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).
Solution 4 - Eclipse
Disable Preferences->General->Text Editors->Annotations->Search Results->Text as.
Solution 5 - Eclipse
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).