       else
         @findView.showFind()
 
-    atom.workspaceView.command 'find-and-replace:show', =>
+    @subscriber.subscribeToCommand atom.workspaceView, 'find-and-replace:show', =>
       @createFindView()
       @projectFindView?.detach()
       @findView.showFind()
 
-    atom.workspaceView.command 'find-and-replace:show-replace', =>
+    @subscriber.subscribeToCommand atom.workspaceView, 'find-and-replace:show-replace', =>
       @createFindView()
       @projectFindView?.detach()
       @findView.showReplace()
 
     # in code editors
-    atom.workspaceView.on 'core:cancel core:close', ({target}) =>
+    @subscriber.subscribeToCommand atom.workspaceView, 'core:cancel core:close', ({target}) =>
       if target isnt atom.workspaceView.getActivePaneView()?[0]
         editor = $(target).parents('.editor:not(.mini)')
         return unless editor.length

    atom.workspace.registerOpener (filePath) =>
      new ResultsPaneView() if filePath is ResultsPaneView.URI

    atom.workspaceView.command 'project-find:show', =>
      @createProjectFindView()
      @findView?.detach()
      @projectFindView.attach()

    atom.workspaceView.command 'project-find:toggle', =>
      @createProjectFindView()
      @findView?.detach()


{$} = require 'atom'
{Subscriber} = require 'emissary'

SelectNext = require './select-next'
FindModel = require './find-model'
