From 18b04595e5655b7cb597371a74cb4b7443cb73c0 Mon Sep 17 00:00:00 2001 From: Sean Usick Date: Sat, 15 Nov 2014 18:24:33 -0600 Subject: [PATCH] disable beautification of specific languages Created option to disable beautification of specific languages. This is useful when a particular language formatter is broken, but you still want beautifyEntireFileOnSave for other languages. --- lib/beautify.coffee | 1 + lib/language-options.coffee | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/beautify.coffee b/lib/beautify.coffee index 0e6f055e..8846a68 100644 --- a/lib/beautify.coffee +++ b/lib/beautify.coffee @@ -318,6 +318,7 @@ plugin.configDefaults = _.merge( beautifyEntireFileOnSave: true muteUnsupportedLanguageErrors: false muteAllErrors: false + disabledLanguages: [] , defaultLanguageOptions) plugin.activate = -> handleSaveEvent() diff --git a/lib/language-options.coffee b/lib/language-options.coffee index 2c74779..ec8c999 100644 --- a/lib/language-options.coffee +++ b/lib/language-options.coffee @@ -155,6 +155,8 @@ module.exports = # Beautify! unsupportedGrammar = false options = undefined + if atom.config.get("atom-beautify.disabledLanguages").indexOf(grammar) > - 1 + return switch grammar # Treat JSON as JavaScript, because it will support comments. # And Glavin001 has tested JSON beauifying with beautifyJS.