From 4eeeede719dbdf012631f9a08e2a06fd3081e51a Mon Sep 17 00:00:00 2001 From: Niklas Larsson Date: Sat, 17 Jun 2017 00:56:05 +0200 Subject: [PATCH] Handle asynchronous save 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 --- lib/idris-controller.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/idris-controller.coffee b/lib/idris-controller.coffee index eb78e87..ac15d59 100644 --- a/lib/idris-controller.coffee +++ b/lib/idris-controller.coffee @@ -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()