     @visible = false
     @enableHoverEvents()
     @recoverFocus()
-    @animate(@conf.hiddenWidth, delay).then (finished) =>
+    @animate @conf.hiddenWidth, delay
+    .then (finished) =>
       @treeView.scroller[0].style.display = 'none' if finished
 
   toggle: (disableHoverEvents = true) ->

    {pushEditor} = @conf

    # wait until the tree view package is activated
    atom.packages.activatePackage('tree-view').then (treeViewPkg) =>
      @registerTreeView treeViewPkg
      @handleEvents()
      # start with pushEditor = true, we'll change it back later


  resize: ->
    promiseNextTick.then() =>
      if @visible then @show 0  else @hide 0
    .catch error

  storeFocusedElement: ->
