RegexSearch
RegexSearch copied to clipboard
Preserve button state of 'Highlight' and re-updated highlights after every search
Hi Mohd,
-
After you use RegexSearch, you close it and re-open, it already preserves most inputs (the regex itself, checkboxes [] Global, [] Case-insensitive...). However, 'Highlight' button toggle state is not preserved. Could you save & restore Highlight button, too.
-
When the user triggers the search (by Search button, or by Enter if you implement #5), could you make it re-highlight current matches, please.
Thank you in advance.
- Actually the highlight button is not a toggle button, it removes older researches then re-research for them again 😄 , so I don't understand what you mean by the first point
- Do you mean you want it to search and highlight the matches with one button or you mean highlight the matches in the
Result
box to copy it faster?
Hi, this is a great extension!
For me the primary use case is the highlighting, and (if I've understood correctly) @peter-kehl would like a quicker way to highlight matches on the page...
Here's my workflow, where I'm reviewing content (it's actually a code review) using a particular regex:
- [Use a keyboard shortcut that changes the content of the page somehow]
- Press Ctrl+Shift+F to open RegexSearch
- Use the mouse (or press TAB several times) to click the "highlight" button
- Press ESC to close the RegexSearch dialog and look at the matches (repeat these steps several times)
Now, in a perfect world, every time the content changed, the highlights would update, but I'm pretty sure this would be terrible for performance!
But it would be nice to be able to refresh the highlights quickly when I know the content has been updated... an extra keyboard shortcut would be awesome, but anything that shortens step (3) above would be great.
The way Peter has requested it would be that if you previously clicked the "highlight" button, next time you press Enter the default action would be to "highlight" again rather than search.
I might put a PR together for the extra keyboard shortcut if I have some spare time later to figure it out :)
Oh, What do you think about hitting enter key will search, hitting enter key + Shift will highlight?
That would be perfect for my use case :)
Ok I've uploaded the new version to Firefox website and here in repo's releases. Now clicking Enter key while focusing on regex input will trigger the search function, however clicking Enter + Shift keys will trigger the highlight function Thank you for your suggestion, I'll wait for @peter-kehl to confirm this is what he meant to close this issue :)
That's awesome, thank you !
Thank you. (Sorry for such a delay.)
Yes for Shift+Enter
. But, if we use it to highlight, then after hitting Shift+Enter if there are any matches, we want the addon's popup to auto-close, so that we can see the page. @fenwar What do you think?