Merge pull request #3513 from UltCombo/beautifier-loop

JS beautifier: fix loop construct, fixes #3510
This commit is contained in:
Nick Winter 2016-04-12 17:13:12 -07:00
commit 5949cf51f0

View file

@ -1193,7 +1193,7 @@ module.exports = class SpellView extends CocoView
onSpellBeautify: (e) -> onSpellBeautify: (e) ->
return unless @spellThang and (@ace.isFocused() or e.spell is @spell) return unless @spellThang and (@ace.isFocused() or e.spell is @spell)
ugly = @getSource() ugly = @getSource()
pretty = @spellThang.aether.beautify ugly pretty = @spellThang.aether.beautify(ugly.replace /\bloop\b/g, 'while (__COCO_LOOP_CONSTRUCT__)').replace /while \(__COCO_LOOP_CONSTRUCT__\)/g, 'loop'
@ace.setValue pretty @ace.setValue pretty
onMaximizeToggled: (e) -> onMaximizeToggled: (e) ->