Is it possible to create a tooltip of some sorts at the cursor?


I’m trying to display a tooltip if a cursor is inside a certain word.

if cursor.isInsideWord
    cursor.onDidChangePosition (event) ->
      if event.cursor.isInsideWord({ wordRegex: "test" })
        div1 = document.createElement('div')
        Test.subscriptions.add atom.tooltips.add(Test.testView.getElement(), {title: 'This is a tooltip'})

However, I can’t seem to get this tooltip to display anywhere. I’d like for it to be displayed where the cursor is. Is this possible?

I’ll cut to the chase, I’m trying to port my silly sublime plugin to atom:

Is something like this possible?


There is another topic here that discusses options for implementing tooltips inside the editor view:

Please continue the discussion there. We like to unify similar discussions under one topic so that people don’t have to read a bunch of different threads to get the whole story. Closing this topic as duplicate unless there are any objections?

closed #3

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.