     activeView = atom.workspaceView.getActiveView()
     if activeView?.hasClass('editor') then activeView else null
 
-  markersUpdated: (markers) ->
+  markersUpdated: =>
     editor = @getEditor()
+    markers = @findModel.markers
 
     if not editor?
       @destroyAllViews()

_ = require 'underscore-plus'
{EditorView, View} = require 'atom'
MarkerView = require './marker-view'

module.exports =
class FindResultsView extends View


  initialize: (@findModel) ->
    @markerViews = {}
    debouncedUpdate = _.debounce(@markersUpdated, 20)
    @subscribe @findModel, 'updated', =>
      if @getEditor()?.hasClass('react')
        # HACK: there are some issues with some of the react editor's components
        # being not available. We shouldnt be doing this rendering anyway.
        # Marker views are coming.
        debouncedUpdate()
      else
        @markersUpdated()

  attach: ->
    editor = @getEditor()
    if editor? and editor.underlayer?
      editor.underlayer.append(this)
    else if editor?
      subscription = @subscribe editor, 'editor:attached', =>
        subscription.off()
        editor.underlayer.append(this)

  detach: ->
    super
