     throw new Error("Packaged not installed: '#{packageName}'") unless atomPackage?
     atomPackage.activateNow()
 
-  runBlank: ->
     @view.stop()
     @activatePackage('script')
     if @blankRuntime.observers
       @blankRuntime.observers.forEach (observer) -> observer.destroy()
       @blankRuntime.observers = []
-    @blankRuntime.addObserver(new ConsoleRuntimeObserver(@view))
+  runBlank: (view) ->
+    @blankRuntime.addObserver(new ConsoleRuntimeObserver(view))
     @blankRuntime.execute()
 
   runDefault: ->

      catch error
        return
      if host is 'editor'
        @view = new ConsoleRuntimeView(editorId: pathname.substring(1))
        @subscriptions.add @view.onDidDestroy => @blankRuntime.stop()
        @subscriptions.add @view.onDidSave (ev) =>
          if atom.config.get 'magic-console.evaluateOnSave'
            @runBlank()
        @view
      else
        @view = new ConsoleRuntimeView(filePath: pathname)
        @subscriptions.add @view.onDidDestroy => @blankRuntime.stop()
        # @subscriptions.add @view.onDidSave (ev) => console.log ev
        @view

  deactivate: ->
    @subscriptions.dispose()

    @subscriptions = new CompositeDisposable
    @subscriptions.add atom.commands.add 'atom-workspace', 'magic-console:toggle':
      => @toggle()
    @views = []
    @blankRuntime = null
    atom.workspace.addOpener (uriToOpen) =>
      try
