Skip to content

Commit

Permalink
Fixes #81. Beautify on Save now retains this scope when beautifying
Browse files Browse the repository at this point in the history
Bug created when developing issue #56.
  • Loading branch information
Glavin001 committed Sep 8, 2014
1 parent e031397 commit 516c356
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/beautify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ beautify = ->
PlainMessageView ?= require('atom-message-panel').PlainMessageView
LoadingView ?= require "./loading-view"
@messagePanel ?= new MessagePanelView title: 'Atom Beautify'
@messagePanel.attach();
@messagePanel.attach() ;
@loadingView ?= new LoadingView()
@loadingView.show()
forceEntireFile = atom.config.get("atom-beautify.beautifyEntireFileOnSave")
Expand Down Expand Up @@ -232,16 +232,16 @@ beautify = ->
@messagePanel.add(new PlainMessageView({
message: e.message,
className: 'text-error'
}));
} )) ;
return

handleSaveEvent = ->
atom.workspace.eachEditor (editor) ->
handleSaveEvent = =>
atom.workspace.eachEditor (editor) =>
buffer = editor.getBuffer()
plugin.unsubscribe buffer
if atom.config.get("atom-beautify.beautifyOnSave")
events = "will-be-saved"
plugin.subscribe buffer, events, beautify
plugin.subscribe buffer, events, beautify.bind(@)
return
return

Expand Down

0 comments on commit 516c356

Please sign in to comment.