diff --git a/lib/beautify.coffee b/lib/beautify.coffee index 8b3fb87..f44a4a4 100644 --- a/lib/beautify.coffee +++ b/lib/beautify.coffee @@ -114,7 +114,7 @@ beautify = ({onSave}) -> # console.log 'Beautify time!' # Get current editor - editor = atom.workspace.getActiveEditor() + editor = atom.workspace.getActiveTextEditor() # Check if there is an active editor if not editor? return showError(new Error("Active Editor not found. " @@ -211,7 +211,7 @@ beautifyDirectory = ({target}) -> return handleSaveEvent = => - atom.workspace.eachEditor (editor) => + atom.workspace.observeTextEditors (editor) => buffer = editor.getBuffer() plugin.unsubscribe buffer if atom.config.get("atom-beautify.beautifyOnSave") diff --git a/lib/loading-view.coffee b/lib/loading-view.coffee index cc423f1..1cb2685 100644 --- a/lib/loading-view.coffee +++ b/lib/loading-view.coffee @@ -1,4 +1,5 @@ -{View} = require "atom" +{View} = require 'space-pen' +{TextEditorView} = require 'atom-space-pen-views' module.exports = class LoadingView extends View @@ -35,4 +36,4 @@ class LoadingView extends View show: => if not @.hasParent() - atom.workspaceView.appendToTop @ + atom.workspace.addTopPanel(item: @) diff --git a/package.json b/package.json index dd05c01..cafcd80 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "strip-json-comments": "^0.1.3", "temp": "^0.8.0", "typescript-formatter": "~0.1.4", - "yaml-front-matter": "^3.2.3" + "yaml-front-matter": "^3.2.3", + "atom-space-pen-views": "^2.0.3" }, "activationCommands": { "atom-workspace": [ diff --git a/stylesheets/beautify.less b/styles/beautify.less similarity index 100% rename from stylesheets/beautify.less rename to styles/beautify.less