     @editorEvents.dispose()
 
     @editorEvents.add editor.onDidAddDecoration (decoration) =>
-      selectedBufferRange = editor.getSelectedBufferRange()
       marker = decoration.getMarker()
-      markerRange = marker.getBufferRange()
-      if markerRange.containsRange(selectedBufferRange)
-        @addMarker(marker) if marker.getProperties().isDartMarker
+      @withValidMarker editor, marker, (marker) =>
+        @addMarker(marker)
+
+    @editorEvents.add editor.onDidRemoveDecoration (decoration) =>
+      marker = decoration.getMarker()
+      @withValidMarker editor, marker, (marker) =>
+        @removeMarker(marker)
 
     @editorEvents.add editor.onDidChangeSelectionRange =>
       selectedBufferRange = editor.getSelectedBufferRange()


  addMarker: (marker) =>
    @view.addProblem(marker.getProperties().problem)

  findMarkersInRange: (editor, range) =>
    attrs =

    return if _.any(@problems, (p) => _.isEqual(p, problem))
    @problems.push problem

  removeProblem: (problem) =>
    _.remove(@problems, (p) => _.isEqual(p, problem))

  reset: =>
    @problems = []

