         treeViewEl = atom.views.getView treeView
         treeViewEl.classList.add 'autohide'
         @applyMinimizedWidth()
-        @subs.add treeViewEl, 'click', => @unfold true
+        @subs.add treeViewEl, 'click', => @show true
         @subs.add treeViewEl,
-          'tree-view:expand-directory': => @unfold true
-          'tree-view:recursive-expand-directory': => @unfold true
-          'tree-view:collapse-directory': => @unfold true
-          'tree-view:recursive-collapse-directory': => @unfold true
+          'tree-view:expand-directory': => @show true
+          'tree-view:recursive-expand-directory': => @show true
+          'tree-view:collapse-directory': => @show true
+          'tree-view:recursive-collapse-directory': => @show true
 
     @subs.add atom.packages.onDidDeactivatePackage (pkg) ->
       if pkg.path.match /\/tree-view\/?/i

      @applyMinimizedWidth()

    @subs.add 'atom-workspace', 'mouseenter', '.tree-view-resizer.autohide', =>
      @unfold()

    @subs.add 'atom-workspace', 'mouseleave', '.tree-view-resizer.autohide', =>
      @fold()

    @subs.add atom.commands.add 'atom-workspace', 'tree-view:toggle', =>
      @applyMinimizedWidth()

  deactivate: ->
    @subs.dispose()

  show: (noDelay) ->
    return unless treeView?.isVisible()
    treeViewEl = atom.views.getView treeView
    width = treeViewEl.querySelector('.tree-view').clientWidth
    if width > treeViewEl.clientWidth then noDelay = true
    transitionDelay = if noDelay then 0 else atom.config.get 'autohide-tree-view.showDelay'
    treeViewEl.style.transitionDelay = "#{transitionDelay}s"
    treeViewEl.style.width = "#{width}px"
    treeView.focus()

  hide: (noDelay) ->
    return unless treeView?.isVisible()
    treeViewEl = atom.views.getView treeView
    width = atom.config.get 'autohide-tree-view.minimizedWidth'
    transitionDelay = atom.config.get 'autohide-tree-view.hideDelay'
    treeViewEl.style.transitionDelay = "#{transitionDelay}s"
    treeViewEl.style.width = "#{width}px"
    treeView.unfocus()
