Skip to content

Commit

Permalink
Handle asynchronous save
Browse files Browse the repository at this point in the history
In atom 1.19 save and a bunch of other Atom will become asynchronous
and return promises. Wait for the promise to be fulfilled.

Fixes #173
  • Loading branch information
melted committed Jun 16, 2017
1 parent 764345c commit 4eeeede
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/idris-controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ class IdrisController
null

saveFile: (editor) ->
if editor.getURI()
editor.save()
else
atom.workspace.saveActivePaneItemAs()
waitsForPromise ->
if editor.getURI()
editor.save()
else
atom.workspace.saveActivePaneItemAs()

typecheckFile: (event) =>
editor = @getEditor()
Expand Down

0 comments on commit 4eeeede

Please sign in to comment.