Detect double click on active TextEditor


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

Something on the line of

    var editor = atom.workspace.getActiveTextEditor();

    //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,

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.


Thank you.