love-ide icon indicating copy to clipboard operation
love-ide copied to clipboard

save all and run shortcut

Open Nikaoto opened this issue 7 years ago • 0 comments

When issuing the love-ide:run-love command, Atom doesn't save every file in the directory, it directly runs the last saved code. I've made a workaround using the atom-save-all package, maybe you could add it as well.

I removed the atom-save-all.cson file (because it overrides ctrl-s to save all instead of the current file) and in my init script, added a 'love: build' command, which dispatches the atom-save-all:saveAll command and then the love-ide:run-love command:

#Saves all files and builds them from love-ide
atom.commands.add 'atom-text-editor', 'love:build', ->
  mEditor = atom.views.getView(atom.workspace.getActiveTextEditor())
  atom.commands.dispatch(mEditor, "atom-save-all:saveAll");
  atom.commands.dispatch(mEditor, "love-ide:run-love");

Then I added a shortcut in my keymap.cson file:

'atom-text-editor':
  'ctrl-shift-b' : 'love:build'

And now the project saves and builds with the latest code. I think implementing this would make the users' lives much easier :)

Nikaoto avatar Jun 20 '17 11:06 Nikaoto