I’m trying to make a macro to insert '* ’ to beginning of each line in selection. It looks like this:
atom.commands.add 'atom-text-editor', 'custom:split-home', -> editor = atom.workspace.getActiveTextEditor() editor.selectAll() editor.splitSelectionsIntoLines() editor.moveToBeginningOfScreenLine()
afterwards I need to clear selection and instert text '* '. Something like that:
editor.clear() # get error because it's not an editor method but a `selection` object method editor.insertText("* ")
And I can’t get around it with
atom.commands.dispatch() because there is no separate command to clear selection.
So, how do I access this method properly?