Fixes #103. BeautifyEntireFileOnSave only applies when saving
This commit is contained in:
parent
9ec22bf43f
commit
dda313fbfe
|
@ -125,7 +125,7 @@ getConfigOptionsFromSettings = (langs) ->
|
|||
# console.log(options);
|
||||
options
|
||||
|
||||
beautify = ->
|
||||
beautify = ({onSave})->
|
||||
path ?= require("path")
|
||||
MessagePanelView ?= require('atom-message-panel').MessagePanelView
|
||||
PlainMessageView ?= require('atom-message-panel').PlainMessageView
|
||||
|
@ -133,7 +133,7 @@ beautify = ->
|
|||
@messagePanel ?= new MessagePanelView title: 'Atom Beautify Error Messages'
|
||||
@loadingView ?= new LoadingView()
|
||||
@loadingView.show()
|
||||
forceEntireFile = atom.config.get("atom-beautify.beautifyEntireFileOnSave")
|
||||
forceEntireFile = onSave && atom.config.get("atom-beautify.beautifyEntireFileOnSave")
|
||||
# Show error
|
||||
showError = (e) =>
|
||||
@loadingView.hide()
|
||||
|
@ -306,7 +306,7 @@ handleSaveEvent = =>
|
|||
plugin.unsubscribe buffer
|
||||
if atom.config.get("atom-beautify.beautifyOnSave")
|
||||
events = "will-be-saved"
|
||||
plugin.subscribe buffer, events, beautify.bind(@)
|
||||
plugin.subscribe buffer, events, beautify.bind(@, {onSave:true})
|
||||
return
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue