     SubAtom ?= require 'sub-atom'
     @disposables = new SubAtom()
 
-    # keep a reference to the package config
-    @conf = atom.config.get 'autohide-tree-view'
-    {pushEditor} = @conf
+    pushEditor = getConfig 'pushEditor'
 
     # wait until the tree view package is activated
     atom.packages.activatePackage 'tree-view'

      @handleEvents()
      # start with pushEditor = true, we'll change it back later
      # activating the package looks much better this way
      @conf.pushEditor = true
      @update()
    .then =>
      # reset the pushEditor setting to the user value
      @conf.pushEditor = pushEditor
      @update()
    .catch error

  deactivate: ->
    # deactivating looks better with pushEditor = true
    @conf.pushEditor = true
    # the stylesheet will be removed before the animation is finished
    # so set minWidth on the element
    @treeViewEl.style.minWidth = '1px'
    # apply new pushEditor value, then show the tree view
    @update().then =>
      # show the tree view
      @show 0
    .then =>
      # finally dispose of everything
      @disposables.dispose()
      [@disposables, @conf, @visible] = []
    .catch error

  registerTreeView: (treeViewPkg) ->

  new Promise (resolve) ->
    process.nextTick ->
      resolve()

getConfig = (key) -> atom.config.get "autohide-tree-view.#{key}"

setConfig = (key, value) -> atom.config.set "autohide-tree-view.#{key}", value

class AutohideTreeView
  config:
