   replaceNext: =>
     @search()
     replacement = @replaceEditor.getText()
-    rootView.getActiveView().trigger('find-and-replace:replace-next', {replacement})
+    @currentEditor().trigger('find-and-replace:replace-next', {replacement})
 
   replaceAll: =>
     @search()
     replacement = @replaceEditor.getText()
-    rootView.getActiveView().trigger('find-and-replace:replace-all', {replacement})
+    @currentEditor().trigger('find-and-replace:replace-all', {replacement})
 
   findPrevious: =>
     @cursorMoveOriginatedHere = true # See HACK above.
-    rootView.getActiveView().trigger('find-and-replace:find-previous')
+    @currentEditor().trigger('find-and-replace:find-previous')
 
   findNext: =>
     @cursorMoveOriginatedHere = true # See HACK above.
-    rootView.getActiveView().trigger('find-and-replace:find-next')
+    @currentEditor().trigger('find-and-replace:find-next')
 
   toggleRegexOption: => @toggleOption('regex')
 


  onActiveItemChanged: =>
    return unless window.rootView
    editor = rootView.getActiveView()
    @trigger('active-editor-changed', editor: editor)

  onCursorMoved: =>

  confirmFind: =>
    @search()
    @findNext()
    editor = @currentEditor()
    editor.focus() if editor and editor.searchResults and editor.searchResults.getCurrentResult().total

  confirmReplace: =>
    @search()
