How are class methods executed, i.e editor.transpose()


#1

I am trying to go through the code and figure out how exactly these methods are called. In atom itself I can use keybindings for some of them, which I understand but where does the instance of the class TextEditor live exactly, so that it can be called, I assume globally?

Some insight would be helpful. Thanks.


#2

Commands can be tied to key combinations via a keybinding. Functions or methods aren’t commands. You have to create a command object and register it with the CommandRegistry for that. The Atom Flight Manual has information on how to create commands in packages.