How do I stop incremental search and keep the highlights?
I start a search, for example typing "ctrl-F cookie".
IDEA highlights all text occurrences.
Now I'd like to get the focus back to the editor to edit relevant parts.
However if I press Esc to get back to the editor all highlights are gone.
Was it always this way? It is a little disturbing that IDEA mocks me by
showing the highlights and just hides them again exactly when I really need them.
Is there another way to get focus back to the editor?
Currently I reach for the mouse which is just lame (breaks my flow a little,
costs time etc.).
Please sign in to leave a comment.
You can just go along editing with the incremental search bar (and the highlights) present and active. You'll have to click to get focus back to the main editing area, which isn't to onerous.
And if you accidentally (or intentionally) cancel an incremental search, remember that one CTRLF activates the incremental search bar and then a second CTRLF activates a pop-up menu of recent patterns from which you can select either by mouse or arrow keys, so you shouldn't have to type the pattern again.
Randall Schulz
I almost never use the mouse while coding, so yes, I consider it onerous. It really interrupts my work.
I would prefer the highlights just to stay. If I want to remove them it's just a second press of ESC.
Randall Schulz wrote:
I think sticky highlights from the search are a good idea - you should create a JIRA ticket for this enhancement.
In the meantime, I can recommend the Plugin "Identifier Highlighter" - this will highlight all occurences of the current identifier and can distinguish between read and write access.
Since the highlighting is triggered automatically, you don't have to leave the editor - however, once the cursor leaves the identifier, the highlights are removed.
It is not exactly what you are looking for, but maybe it can be helpful as well.
Edit: Here is the link to the plugin http://plugins.intellij.net/plugin/?id=1236
Edited by: Christian Schwanke on Sep 24, 2008 10:20 AM
On the Mac CmdEnter does the trick, on windows it is probably CtrlEnter. This keyboard shortcut moves the text cursor to the currently selected element which was found, but keeps all highlights and the search bar stays open.
Bas
Thanks Bas,
I'm glad to have that functionality.
I just wonder how that shortcut can somehow be shown in the UI (toolbar button "Focus Editor"?).
It's something nobody would ever be able to guess.
Personally I think the short cut should be F4 (maybe in addition to Cmd+Enter), as it is in other places. Did you get around to filing an issue for this problem?
Bas