try .jsbeautifierrc and update docs

This commit is contained in:
Philipp Zins 2014-05-13 07:37:54 +02:00
parent 0bc284a7fd
commit f43b4eb7eb
3 changed files with 19 additions and 5 deletions

8
.jsbeautifierrc Normal file
View File

@ -0,0 +1,8 @@
{
"indent_size": 2,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2
}

View File

@ -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
- beautify JS, HTML and CSS files based on current editor settings

View File

@ -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);
};
};