I define a custom command in init.coffee which opens a new pane and does some output there, but I want to keep the focus (cursor) on the text editor. I tried two commands to get this behavior, but both don’t work. In init.coffee I have:
atom.commands.add 'atom-text-editor', 'custom:command', -> editor = atom.workspace.getActivePaneItem() ... atom.commands.dispatch(atom.views.getView(editor), 'command:newPane') # try to get focus back # this doesn't work: atom.workspace.activatePreviousPane() # this doesn't work either: atom.commands.dispatch(atom.views.getView(atom.workspace), 'window:focus-previous-pane')
If I run
from the command palette it works, though.