-{CompositeDisposable, TextEditor, Emitter} = require 'atom'
+{CompositeDisposable, TextEditor} = require 'atom'
 path = require 'path'
 
 History    = null

    @subscriptions.add @observeTextEditors()
    @subscriptions.add @observeActivePaneItem()
    @subscriptions.add @observeOnWillDestroyPaneItem()
    @subscriptions.add @onWillJumpToHistory (direction) =>
      @lock()

    @subscriptions.add @onDidJumpToHistory (direction) =>
      @unLock()
      Flasher ?= require './flasher'
      Flasher.flash() if settings.get('flashOnLand')
      @history.dump direction

  deactivate: ->
    for editorID, disposables of @editorSubscriptions
      disposables.dispose()
    @editorSubscriptions = null
    @subscriptions.dispose()
    settings.dispose()
    @history?.destroy()
    @history = null
    @emitter = null

  # For better handling symbols-view.
  # -------------------------

  history:    null
  lastEditor: null
  locked:     false
  delayedUnLockTask: null

  subscriptions: null
  editorSubscriptions: null

  activate: ->
    History = require './history'
    LastEditor = require './last-editor'

    @subscriptions = new CompositeDisposable
    @editorSubscriptions = {}
    @history       = new History settings.get('max')

    @rowDeltaToRemember = settings.get('rowDeltaToRemember')
