I would like to implement a feature :when the mouse is hovered over a variable name and ctrl is pressed, then the mouse will become clickable and when clicked, it can jump to the appropriate line of code.
I’ve already implemented variable recognition, so here’s what I need now:
when ctrl is pressed, how to make the mouse clickable
CodeMirror doesn’t know enough about your code to tell you where a given identifier is defined. If you do have that information, for example by integrating a language server, cursor jumping shouldn’t be hard to implement.
Thanks for the reply.
I know I can trigger a transaction by binding to a key-map (via view.dispatch as you said), but I don’t know how to make the mouse cursor clickable in a transaction, can you help me with this? Thank you very much!