 
   show: (noDelay, disableHoverEvents) ->
     return unless @enabled
+    @applyHiddenWidth()
     width = treeViewEl.querySelector('.tree-view').clientWidth
     if width > treeViewEl.clientWidth > @getHiddenWidth()
       noDelay = true


  applyHiddenWidth: (width) ->
    return unless @enabled
    console.log 'autohide-tree-view: ', treeViewEl.parentNode
    width = @getHiddenWidth() if isNaN parseInt width
    treeViewEl.style.width = "#{width}px"
    treeViewEl.parentNode.style.width = "#{width}px"

  getAnimate: -> atom.config.get 'autohide-tree-view.animate'



  enable: (treeViewPkg) ->
    try
      treeViewPkg ?= atom.packages.getActivePackage 'tree-view'
      return unless treeViewPkg?
      @enabled = true
      treeView = treeViewPkg.mainModule.createView()
      treeViewEl = atom.views.getView treeView
      treeViewEl.classList.add 'autohide', 'autohide-hover-events'
      @applyHiddenWidth()
      @applyAnimate()
      @hide true
    catch e
      console.error e

