Merge branch 'master' of github.com:Glavin001/atom-beautify

This commit is contained in:
Petru Ilies 2016-04-08 19:30:38 +03:00
commit 3fe678ce31
4 changed files with 23 additions and 5 deletions

View File

@ -83,7 +83,7 @@ It will only beautify selected text if a selection is found -- if not, the whole
### Shortcut
You can also type `ctrl-alt-b` as a shortcut or click `Packages > Beautify` in the menu.
You can also type <kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>B</kbd> as a shortcut or click `Packages > Beautify` in the menu.
#### Custom Keyboard Shortcuts

View File

@ -1,7 +1,7 @@
{
"name": "atom-beautify",
"main": "./src/beautify",
"version": "0.29.1",
"version": "0.29.2",
"private": true,
"description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, and SQL in Atom",
"repository": {
@ -99,7 +99,7 @@
"handlebars": "^4.0.2",
"js-beautify": "^1.6.2",
"jscs": "^2.1.1",
"lodash": "4.6.1",
"lodash": "^4.8.2",
"loophole": "^1.0.0",
"node-dir": "^0.1.8",
"node-uuid": "^1.4.3",

View File

@ -217,13 +217,28 @@ describe "Atom-Beautify", ->
expect(atom.config.get("atom-beautify.#{afterKey}")).toBe(val)
it "should migrate js_indent_size to js.indent_size", ->
migrateSettings("js_indent_size","js.indent_size", 1)
migrateSettings("js_indent_size","js.indent_size", 10)
it "should migrate analytics to general.analytics", ->
migrateSettings("analytics","general.analytics", true)
migrateSettings("analytics","general.analytics", false)
it "should migrate _analyticsUserId to general._analyticsUserId", ->
migrateSettings("_analyticsUserId","general._analyticsUserId", "userid")
migrateSettings("_analyticsUserId","general._analyticsUserId", "userid2")
it "should migrate language_js_disabled to js.disabled", ->
migrateSettings("language_js_disabled","js.disabled", false)
migrateSettings("language_js_disabled","js.disabled", true)
it "should migrate language_js_default_beautifier to js.default_beautifier", ->
migrateSettings("language_js_default_beautifier","js.default_beautifier", "Pretty Diff")
migrateSettings("language_js_default_beautifier","js.default_beautifier", "JS Beautify")
it "should migrate language_js_beautify_on_save to js.beautify_on_save", ->
migrateSettings("language_js_beautify_on_save","js.beautify_on_save", true)
migrateSettings("language_js_beautify_on_save","js.beautify_on_save", false)
beautifyEditor = (callback) ->
isComplete = false

View File

@ -522,7 +522,10 @@ getUnsupportedOptions = ->
plugin.checkUnsupportedOptions = ->
unsupportedOptions = getUnsupportedOptions()
if unsupportedOptions.length isnt 0
atom.notifications.addWarning("You have unsupported options: #{unsupportedOptions.join(', ')} <br> Please run Atom command 'Atom-Beautify: Migrate Settings'.")
atom.notifications.addWarning("Please run Atom command 'Atom-Beautify: Migrate Settings'.", {
detail : "You have unsupported options: #{unsupportedOptions.join(', ')}",
dismissable : true
})
plugin.migrateSettings = ->
unsupportedOptions = getUnsupportedOptions()
@ -546,9 +549,9 @@ plugin.migrateSettings = ->
# Move all option values to renamed key
_.each(rename, ([key, newKey]) ->
# console.log('rename', key, newKey)
# Copy to new key
val = atom.config.get("atom-beautify.#{key}")
# console.log('rename', key, newKey, val)
atom.config.set("atom-beautify.#{newKey}", val)
# Delete old key
atom.config.set("atom-beautify.#{key}", undefined)