 
 metrics = throttle metrics, 60*60*1000
 
-resultEditorRegistry = {}
+resultEditorRegistry = new Set
+layers = {}
 
 module.exports =
 class Result

      result.invalidate()

  @forLines: (ed, start, end, type = 'any') ->
    ed.findMarkers().filter((m) -> m.result? &&
                                   m.getBufferRange().intersectsRowRange(start, end) &&
                                  (m.result.type == type || type == 'any'))
                    .map((m) -> m.result)

  @removeLines: (ed, start, end, type = 'any') ->
    rs = @forLines(ed, start, end, type)
    rs.map (r) -> r.remove()
    rs.length > 0

  @removeAll: (ed = atom.workspace.getActiveTextEditor()) ->
    ed?.findMarkers().filter((m) -> m.result?).map((m) -> m.result.remove())

  @removeCurrent: (e) ->
    if (ed = atom.workspace.getActiveTextEditor())

        resultEditorRegistry[ed.id] = true
        # create new editor specific result animation method
        listener = debounce((->
          res = layers[ed.id].getMarkers().filter((m) -> m.result?).map((m) -> m.result)
          # reads
          rect = null
          fastdom.measure ->
