       'cursor-history:toggle-debug': => @toggleConfig('debug')
 
     @modalPanelContainer = atom.workspace.panelContainers['modal']
+
     @subscriptions.add @modalPanelContainer.onDidAddPanel ({panel, index}) =>
       # itemKind in ['GoToView', 'GoBackView', 'FileView', 'ProjectView']
       itemKind = panel.getItem().constructor.name
       return unless itemKind in ['FileView', 'ProjectView']
       switch itemKind
         when 'FileView'
-          [editor, point] = []
-          @symbolsViewFileView = {panel, item: panel.getItem()}
-          panel.onDidChangeVisible (visible) =>
-            editor = @getActiveTextEditor()
-            if visible
-              point = editor.getCursorBufferPosition()
-              @lock()
-              console.log "shown #{itemKind}"
-            else
-              setTimeout =>
-                newPoint = editor.getCursorBufferPosition()
-                console.log "move from #{point.toString()} -> #{newPoint.toString()}"
-                if @needRemember(point, newPoint, null)
-                  @history.add editor, point, editor.getURI(), dumpMessage: "[Cursor moved] save history"
-                @unLock()
-                console.log "hidden #{itemKind}"
-              , 300
+          @handleSymbolsViewFileView panel
         when 'ProjectView'
-          @symbolsViewProjectView = {panel, item: panel.getItem()}
+          @handleSymbolsViewProjectView panel
 
 
     @subscriptions.add atom.workspace.observeTextEditors (editor) =>

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


  #   @_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
