From 7bd73483233ff0c140c8388c01f71cf178cbf99d Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Thu, 10 Aug 2017 20:56:14 -0500 Subject: [PATCH] Fix for #1721 --- src/beautify.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/beautify.coffee b/src/beautify.coffee index 7cae9cc..55f568f 100644 --- a/src/beautify.coffee +++ b/src/beautify.coffee @@ -542,9 +542,10 @@ handleSaveEvent = -> # It will add a newline and keep the file from converging on a beautified form # and saving without emitting onDidSave event, because there were no changes. pendingPaths[filePath] = true - editor.save() - delete pendingPaths[filePath] - logger.verbose('Saved TextEditor.') + Promise.resolve(editor.save()).then(() -> + delete pendingPaths[filePath] + logger.verbose('Saved TextEditor.') + ) ) .catch((error) -> return showError(error)