From f43b4eb7ebaeb05a64eabe9a2155e742921580bb Mon Sep 17 00:00:00 2001 From: Philipp Zins Date: Tue, 13 May 2014 07:37:54 +0200 Subject: [PATCH] try .jsbeautifierrc and update docs --- .jsbeautifierrc | 8 ++++++++ CHANGELOG.md | 7 ++++++- lib/atom-beautify.js | 9 +++++---- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .jsbeautifierrc diff --git a/.jsbeautifierrc b/.jsbeautifierrc new file mode 100644 index 0000000..a6129b7 --- /dev/null +++ b/.jsbeautifierrc @@ -0,0 +1,8 @@ +{ + "indent_size": 2, + "indent_char": " ", + "indent_level": 0, + "indent_with_tabs": false, + "preserve_newlines": true, + "max_preserve_newlines": 2 +} diff --git a/CHANGELOG.md b/CHANGELOG.md index b2c6826..d491906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v0.2.3 (2014-05-13) + +- support `.jsbeautifierrc` (thanks @karolyi) +- fixed: reload on save (thanks @karolyi) + # v0.2.2 (2014-03-18) - added experimental support for XML (thanks @mtanzi) @@ -9,4 +14,4 @@ # v0.2.0 (2014-03-11) - public release -- beautify JS, HTML and CSS files based on current editor settings \ No newline at end of file +- beautify JS, HTML and CSS files based on current editor settings diff --git a/lib/atom-beautify.js b/lib/atom-beautify.js index a204caf..7ca5c14 100644 --- a/lib/atom-beautify.js +++ b/lib/atom-beautify.js @@ -136,7 +136,7 @@ function beautify() { } function handleSafeEvent() { - atom.workspace.eachEditor(function (editor) { + atom.workspace.eachEditor(function(editor) { var buffer = editor.getBuffer(); plugin.unsubscribe(buffer); @@ -151,9 +151,10 @@ plugin.configDefaults = { beautifyOnSave: false }; -plugin.activate = function () { +plugin.activate = function() { handleSafeEvent(); - plugin.subscribe(atom.config.observe('atom-beautify.beautifyOnSave', + plugin.subscribe(atom.config.observe( + 'atom-beautify.beautifyOnSave', handleSafeEvent)); return atom.workspaceView.command('beautify', beautify); -}; +}; \ No newline at end of file