ufb / Textmarker

Firefox extension
Mozilla Public License 2.0
212 stars 29 forks source link

Highlight all occurences mode (without saving) #64

Open karel-dolezal opened 5 years ago

karel-dolezal commented 5 years ago

It would be extremely helpful to highlight all occurrences of selected identifier(s) during code review here on github. To generalize this request, it would suffice to highlight all matching words on the page by single command.

Usage flow: Double-ckick a word -> Select color -> See all usages of that word on page Screenshot from 2019-05-23 16-33-15

When simply used as a way to get better orientation in large code, this does not need saving, so no need for complicated implementation as indicated in this related request https://github.com/ufb/Textmarker/issues/41 .

ufb commented 5 years ago

Hi Karel, as mentioned in my e-mail I will have another look into this and I'm confident that this could become a new feature for a later release (not the upcoming one though). The earliest would be in 2-3 months, though. The reason why I dropped #41 was two-fold: a) Too error-prone when being saved and b) highlighting all occurences without saving the highlights does already exist natively in Firefox (Ctrl+F). But I understand that highlighting multiple search terms simultaneously is not being covered by this built-in feature: A good reason to implement it ourselves ;) That being said, I can imagine that there is already an extension out there doing exactly that, so before inventing the wheel once more I will do some research on it...

btw: Thanks a lot for your debugging help via e-mail. Most users wouldn't bother helping out, but rather post ugly reviews instead^^

ufb commented 5 years ago

@karel-dolezal Hey, I did a quick extensions search just now and found this one: HighlightAll It's pretty much doing exactly what you were looking for. You might have to adjust its settings from native to custom and add highlight colors manually - after that you are good to go.

BTW: Release Textmarker v5 yesterday.

karel-dolezal commented 5 years ago

@ufb Hello, yes I know, I've tried it before. Sadly, it has performance issues even on moderately small pages, and the latest revision's UI randomly disappears, making it very hard (even infuriating) to work with.

I've also found multi-keywords-highlighter, which is basic, has no shortcuts, but looks pretty and kind-of works. Unfortunately you have to write a list of comma separated words into a box manually, and it is no longer maintained.

Therefore, I still think your plugin would do the job better, if you decided to do it. Not trying to pressure you into more work, just letting you know that it would still be greatly appreciated.

PS: Updated textmarker just now. Thanks for the fixes! :+1:

ufb commented 5 years ago

I'll leave this issue open for now. Might implement this feature for a future version - or just publish a separate extension for this, since it's not easy to communicate to all users that highlights created with "highlight all occurrences" are not being saved.