 {StacktraceView} = require './stacktrace-view'
 {NavigationView} = require './navigation-view'
 {decorate, cleanup} = require './editor-decorator'
+
+subs = []
 
 module.exports =
 


    StacktraceView.registerIn(atom.workspace)

    @acceptTrace = atom.on 'stacktrace:accept-trace', ({trace}) =>
      for trace in Stacktrace.parse(trace)
        trace.register()
        atom.workspace.open trace.getUrl()

    atom.workspaceView.command 'stacktrace:follow-call', ->
      NavigationView.current()?.navigateToCalled()

    subs.push atom.workspace.eachEditor decorate
    subs.push Stacktrace.on 'active-changed', (e) ->
      cleanup()
      if e.newTrace?
        decorate(e) for e in atom.workspace.getEditors()
