-{CompositeDisposable, TextEditor, Emitter} = require 'atom'
+{CompositeDisposable, Disposable, TextEditor, Emitter} = require 'atom'
 path = require 'path'
 _    = require 'underscore-plus'
 

    @debug "set LastEditor #{path.basename(item.getURI())}"

  handleCursorMoved: ({oldBufferPosition, newBufferPosition, cursor}) ->
    return if @symbolsViewFileView?.panel.isVisible()
    editor = cursor.editor
    return if editor.hasMultipleCursors()
    return unless URI = editor.getURI()

    if @needRemember(oldBufferPosition, newBufferPosition, cursor)
      @history.add editor, oldBufferPosition, URI, dumpMessage: "[Cursor moved] save history"

  # Throttoling save to history once per 500ms.
  # When activePaneItem change and cursorMove event happened almost at once.

  #   @_saveHistory ?= _.throttle(@history.add.bind(@history), 500, trailing: false)
  #   @_saveHistory editor, point, URI, options

  # saveHistory: (editor, point, URI, options)->
  #   @_saveHistory ?= _.throttle(@history.add.bind(@history), 500, trailing: false)
  #   @_saveHistory editor, point, URI, options

  needRemember: (oldBufferPosition, newBufferPosition) ->
    # console.log "Called NeedRemember"
    # Line number delata exceeds or not.
    Math.abs(oldBufferPosition.row - newBufferPosition.row) > @rowDeltaToRemember

  lock:     -> @locked = true
  unLock:   -> @locked = false
