So here’s the problem: I have custom tooltips in editor that are modeled with overlay decorations. Here’s an example:
Notice how said tooltip overlays part of the editor text. Now then, imagine user moving his cursor under the tooltip. That wouldn’t be very nice if tooltip hides that (which it does). So I would like to set
opacity: 0.3 or hide the tooltip outright if it happens.
Now the question is, how do I detect that cursor is indeed under the decoration? I can of course subscribe to
TextEditor.onDidChangeSelectionRange, but what should I do inside is a big question.
I wrote some proof-of-concept code that works, but it uses Atom internals (
TextEditorComponent) and relies heavily on direct DOM queries (
getBoundingClientRect), and now I’m wondering if I missed some obvious easier way of doing the same.
Here’s a gif demonstrating what I’m trying to achieve: