parent
d068bfe0b3
commit
c6760ef3fe
|
@ -1,6 +1,9 @@
|
|||
# Next
|
||||
- ...
|
||||
|
||||
# v0.30.9 (2017-11-22)
|
||||
- Fix [#1949](https://github.com/Glavin001/atom-beautify/issues/1949): Fix beautify on save when text has not changed.
|
||||
|
||||
# v0.30.8 (2017-11-22)
|
||||
- Fix [#1949](https://github.com/Glavin001/atom-beautify/issues/1949): Fix beautify on save when text has not changed.
|
||||
|
||||
|
|
|
@ -96,9 +96,10 @@ beautify = ({ editor, onSave, language }) ->
|
|||
if not text?
|
||||
# Do nothing, is undefined
|
||||
# console.log 'beautifyCompleted'
|
||||
return resolve(text)
|
||||
else if text instanceof Error
|
||||
showError(text)
|
||||
return reject(text)
|
||||
return resolve(text)
|
||||
else if typeof text is "string"
|
||||
if oldText isnt text
|
||||
|
||||
|
@ -127,15 +128,18 @@ beautify = ({ editor, onSave, language }) ->
|
|||
# otherwise setScrollTop is not working, probably because the cursor
|
||||
# addition happens asynchronously
|
||||
setTimeout ( ->
|
||||
|
||||
# console.log "setScrollTop"
|
||||
setScrollTop editor, origScrollTop
|
||||
return resolve(text)
|
||||
), 0
|
||||
else
|
||||
return setTimeout(() ->
|
||||
resolve(text)
|
||||
, 0)
|
||||
else
|
||||
error = new Error("Unsupported beautification result '#{text}'.")
|
||||
showError(error)
|
||||
return setTimeout(-> resolve(text), 0)
|
||||
return resolve(text)
|
||||
|
||||
# else
|
||||
# console.log "Already Beautiful!"
|
||||
|
|
Loading…
Reference in New Issue