Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight when hovering variable on mrs.js doesn't have memory #7

Open
yfaria opened this issue Aug 2, 2021 · 2 comments
Open

Highlight when hovering variable on mrs.js doesn't have memory #7

yfaria opened this issue Aug 2, 2021 · 2 comments

Comments

@yfaria
Copy link

yfaria commented Aug 2, 2021

I am implementing a web page that is built upon mrs.js for reimplementing the WSI interface (https://github.com/own-pt/wql/tree/demo/flask-demo).
I need to highlight the matches that are relative to the pattern that matched and I still want to keep the highlighting of all variables of same name when hovering the variable name. The problem is that the code of the event mouseleave is harcoded to put every variable highlighted to black, overwriting my highlight of the matches. I can create a new event listener to solve this problem, but wouldn't it the be better if the code natively had this support to place the old color instead of always putting the same color?

@goodmami
Copy link
Member

goodmami commented Aug 3, 2021

That sounds like a useful improvement. Note that mrs.js and dmrs.js were developed separately by different people. I wrote dmrs.js so that hovering on a node highlights it and things it's connected to (similar to how mrs.js works), but also you can click a node to make the highlighting persistent. Clicking another node highlights that one instead. To clear highlighting, you click on the highlighted node again, but it's not obvious that it's been cleared until you move the cursor away from the node.

I think such a system for mrs.js sounds useful and I think we would accept a pull request that accomplishes that. Or you may have some better idea, which would also be welcome.

@arademaker
Copy link
Member

Thank you @goodmami, @yfaria is working with me. We will make our best to contribute to this repo considering the changes we may need for our use case (wsi interface)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants