When you select some text in the editor and press CTRL + P the selected text is automatically inserted into the search input. That is the main point of the extension and it works perfectly (when you need it).
One improvement, thought, would be to also make the behavior of this extension more friendly to the user when he actually don't need to search the selected text. I.e. when there is a selected text in the editor, but the user needs to search something totally different, unrelated to this selected text.
Currently in this situation (and when this extension is installed) you need to manually remove the auto-inserted text when the search panel is opened. It is not hard to manually remove the text, but often you just don't aware of the fact that when you pressed CTRL + P you had some selected text in the editor. So, you pressing the hotkey and you starting to enter the text you want to search and only later you realize that the search field already had some text, so now you need to press <- several times to remove the old text and then continue the input, or (more easily) just remove everything and start from scratch. It could be pretty annoying. Also this violates the default behavior (without this extension), so users who used to it will uninstall the extension because it gets in the way of their habitual patterns.
I think there is a way to get the best of two worlds:
- The benefits this extension provides.
- Keep the default behavior when you actually didn't want to search the selected text when pressed the hotkey.
One way to achieve it (and it is how it is done in all other editors I know, e.g. IntelliJ IDEA) is to pre-select all the text that was automatically inserted into the search input. E.g. if you selected file.jpg in the editor and pressed CTRL + P, the opened search input will contain file.jpg text already selected. So, if you start to input new text, this file.jpg text will be automatically removed (because if you select some text and start to input something else, the selected text will be removed automatically).
This way the behavior this extension provides will be 100% non-intrusive. Even when this extension is installed and some text in the editor is selected, pressing CTRL + P and starting to enter text into the search field will work exactly the same, as it worked without this extension. But you will still have all the benefits provided but this extension.
It is also similar to the way the HTML <input> works. When the <input> already has text and you focus this <input> by keyboard (by pressing TAB), the text in the focused <input> will be pre-selected. I think the reasons for this standard behavior are the same: to make it easier to enter a new text if you want to, but also keep the ability to edit the existing text (you can just press -> to unselect it) in you need it.
When you select some text in the editor and press CTRL + P the selected text is automatically inserted into the search input. That is the main point of the extension and it works perfectly (when you need it).
One improvement, thought, would be to also make the behavior of this extension more friendly to the user when he actually don't need to search the selected text. I.e. when there is a selected text in the editor, but the user needs to search something totally different, unrelated to this selected text.
Currently in this situation (and when this extension is installed) you need to manually remove the auto-inserted text when the search panel is opened. It is not hard to manually remove the text, but often you just don't aware of the fact that when you pressed CTRL + P you had some selected text in the editor. So, you pressing the hotkey and you starting to enter the text you want to search and only later you realize that the search field already had some text, so now you need to press <- several times to remove the old text and then continue the input, or (more easily) just remove everything and start from scratch. It could be pretty annoying. Also this violates the default behavior (without this extension), so users who used to it will uninstall the extension because it gets in the way of their habitual patterns.
I think there is a way to get the best of two worlds:
One way to achieve it (and it is how it is done in all other editors I know, e.g. IntelliJ IDEA) is to pre-select all the text that was automatically inserted into the search input. E.g. if you selected
file.jpgin the editor and pressed CTRL + P, the opened search input will containfile.jpgtext already selected. So, if you start to input new text, thisfile.jpgtext will be automatically removed (because if you select some text and start to input something else, the selected text will be removed automatically).This way the behavior this extension provides will be 100% non-intrusive. Even when this extension is installed and some text in the editor is selected, pressing CTRL + P and starting to enter text into the search field will work exactly the same, as it worked without this extension. But you will still have all the benefits provided but this extension.
It is also similar to the way the HTML
<input>works. When the<input>already has text and you focus this<input>by keyboard (by pressing TAB), the text in the focused<input>will be pre-selected. I think the reasons for this standard behavior are the same: to make it easier to enter a new text if you want to, but also keep the ability to edit the existing text (you can just press -> to unselect it) in you need it.