Detect double click on active TextEditor


#1

What would be the correct way to detect double click on a TextEditor instance ?

Something on the line of

    var editor = atom.workspace.getActiveTextEditor();

    editor.ondoubleclick(function(){
    //do stuff
    })

Now I know it’s not done that way …
I can of course look for editor elements in the dom and attach events to them but is that it ?

Thank you,


#2
var editor = atom.workspace.getActiveTextEditor();

atom.views.getView(editor).addEventListener('dblclick', () ->
    console.log('double clicked')
)

That’s the way I would do it. I’m not sure there is any better way at the moment.


#3

Thank you.