 {CompositeDisposable, TextEditor} = require 'atom'
-CursorHistory = require './history'
+History = require './history'
 path = require 'path'
 
 module.exports =

    @direction = direction

    URI = marker.getProperties().URI
    pos = marker.getStartBufferPosition()

    if activeEditor.getURI() is URI
      # Jump within active editor.
      activeEditor.setCursorBufferPosition pos
      return

    atom.workspace.open(URI, searchAllPanes: true).done (editor) =>
      # Jump to another another file.
      editor.setCursorBufferPosition pos

    @subscriptions.add atom.workspace.observeTextEditors (editor) =>
      @subscriptions.add editor.onDidChangeCursorPosition @handleCursorMoved.bind(@)

    @subscriptions.add atom.workspace.observeActivePaneItem @handlePaneChanged.bind(@)

  dumpLastEditor: ->
    URI   = @lastEditor.getURI()
    point = @lastEditor.getCursorBufferPosition()
    @debug "lastEditor = #{point} #{URI}, "

  inspectEditor: (editor) ->
    URI   = @lastEditor.getURI()
    point = @lastEditor.getCursorBufferPosition()
    "#{point} #{path.basename(URI)}"

  dump: ->
    @dumpLastEditor()
    @history.dump '', true

  toggleDebug: ->
