       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

{$} = require 'atom'

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

    ResultsPaneView.model = null
    @resultsModel = null

    @subscriber?.unsubscribe()
    @subscriber = null

  serialize: ->
    viewState: @findView?.serialize() ? @viewState
