From 92d728295f5d2eb6786bd636bae7633c8f76279b Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Thu, 30 Aug 2012 16:12:34 -0600 Subject: [PATCH] Don't assume save is always passed a success callback --- src/app/editor.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index e52475c7c..4176df1b0 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -517,14 +517,14 @@ class Editor extends View $(window).off 'resize', @_setSoftWrapColumn save: (onSuccess) -> - if not @getPath() + if @getPath() + @getBuffer().save() + onSuccess?() + else atom.showSaveDialog (path) => if path @getBuffer().saveAs(path) - onSuccess() - else - @getBuffer().save() - onSuccess() + onSuccess?() subscribeToFontSize: -> return unless rootView = @rootView()