From: Alexander Barton Date: Tue, 26 May 2015 14:22:40 +0000 (+0200) Subject: Update ./lib/pipe.coffe to use current API X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=refs%2Fheads%2Fupdate-pipe.coffee;p=atom-ax-pipe.git Update ./lib/pipe.coffe to use current API This fixes the following two deprecation warnings: "Workspace.getActiveEditor is deprecated. Call ::getActiveTextEditorinstead." "atom.workspaceView is no longer available. In most cases you will not need the view. See the Workspace docs for alternatives: https://atom.io/docs/api/latest/Workspace. If you do need the view, please use `atom.views.getView(atom.workspace)`, which returns an HTMLElement." --- diff --git a/lib/pipe.coffee b/lib/pipe.coffee index 97ada8a..c9de027 100644 --- a/lib/pipe.coffee +++ b/lib/pipe.coffee @@ -9,10 +9,11 @@ module.exports = atom.commands.add 'atom-workspace', "pipe:run", => @run() run: -> - editor = atom.workspace.getActiveEditor() - view = atom.workspaceView.getActiveView() + editor = atom.workspace.getActiveTextEditor() return if not editor? + view = atom.views.getView(atom.workspace) + new CommandView history, (commandString) -> if not commandString view.focus()