diff --git a/lib/index.coffee b/lib/index.coffee index 7a98028..7ae6508 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -11,6 +11,9 @@ module.exports = maxLineLength: type: 'integer' default: 100 + grammars: + type: 'array' + default: ["Python", "MagicPython"] cmdLineOptions: type: 'array' default: [] diff --git a/lib/python-autopep8.coffee b/lib/python-autopep8.coffee index d139280..d865470 100644 --- a/lib/python-autopep8.coffee +++ b/lib/python-autopep8.coffee @@ -8,8 +8,9 @@ class PythonAutopep8 editor = atom.workspace.getActiveTextEditor() if not editor? return false - grammar = editor.getGrammar().name - return grammar == 'Python' or grammar == 'MagicPython' + grammarNames = atom.config.get "python-autopep8.grammars" + grammarName = editor.getGrammar().name + return grammarName in grammarNames removeStatusbarItem: => @statusBarTile?.destroy() @@ -42,6 +43,7 @@ class PythonAutopep8 format: -> if not @checkForPythonContext() + @updateStatusbarText("x", true) return cmd = atom.config.get "python-autopep8.autopep8Path"