-
Notifications
You must be signed in to change notification settings - Fork 39
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add event
arg to on_hover
to expose modifiers
to determine if modifier keys are being held
#6464
Comments
Do you have a concrete example of a feature this would enable? Modifier-sensitive hover popups are not something I've ever seen in any application. |
Use Cases
Also, clicking while hovering pops up a listitem handler so that they can also navigate code that way |
I'd image there could be more use cases, but to summarize I think we get
|
For this feature we'd rather need something like |
There is a similar feature in zed and I find it refreshing. While hovering if you press and hold CMD it turns the text under into a link if it has info and on it. I do not know the exact impl details as I haven’t really sug. But it works well. Although I see that an on_move would compliment this and make the feature richer |
There is currently no "unhover" event so it would stay with a region until somewhere else is hovered and the region gets moved presumably... |
Ahh I see what @rchl and you are saying. Yea, maybe 3rd use case would still be buggy. And need an on_move counter part |
Problem description
Currently, the on_hover function in Sublime Text allows developers to execute specific actions when a user hovers over a defined hover_zone. However, the function does not provide any mechanism to detect if a modifier key (e.g., Ctrl, Alt, Shift, Cmd) is being held during the hover event. This limitation restricts developers from implementing more nuanced and context-sensitive hover interactions, which could significantly enhance the usability and functionality of plugins.
For example, a plugin might want to display different tooltips or trigger different actions depending on whether the user is simply hovering over an element or doing so while holding a modifier key.
Preferred solution
Enhance the existing on_hover function by exposing the state of modifier keys during the hover event. The implementation could include the following changes:
By implementing this feature, developers will have the flexibility to create more interactive and user-friendly plugins that can respond dynamically to user input based on modifier keys, enhancing the overall experience within Sublime Text.
Alternatives
None that I know of
Additional Information
No response
The text was updated successfully, but these errors were encountered: