]> arthur.barton.de Git - atom-ax-pipe.git/commitdiff
Update ./lib/pipe.coffe to use current API update-pipe.coffee
authorAlexander Barton <alex@barton.de>
Tue, 26 May 2015 14:22:40 +0000 (16:22 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 26 May 2015 14:26:43 +0000 (16:26 +0200)
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."

lib/pipe.coffee

index 97ada8a8b67092cfa294a493be4fdc635a32694f..c9de02787c397b6a6ee0879929876b8f35a425a3 100644 (file)
@@ -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()