     @disposables.add atom.config.onDidChange 'tree-view.hideVcsIgnoredFiles', => @update()
     @disposables.add atom.config.onDidChange 'core.ignoredNames', => @update()
 
-    # add listeners for mouse events
+    # add listeners for mouse events and update them each time config.showOn gets updated
     mouseEventDisposables = null
     @disposables.add atom.config.observe 'autohide-tree-view.showOn', (value) =>
+      # dispose of previously set listeners
       mouseEventDisposables?.dispose()
       @disposables.add mouseEventDisposables = new SubAtom()
       if value.match 'hover'
+        # show the tree view when it is hovered
         mouseEventDisposables.add 'atom-workspace', 'mouseenter', '.tree-view-resizer.autohide-hover', => @show()
         mouseEventDisposables.add 'atom-workspace', 'mouseleave', '.tree-view-resizer.autohide-hover', => @hide()
         # disable the tree view from showing/hiding during a selection
         mouseEventDisposables.add 'atom-text-editor', 'mousedown', => @disableHoverEvents()
         mouseEventDisposables.add 'atom-text-editor', 'mouseup', => @enableHoverEvents()
       if value.match 'click'
+        # toggle the tree view when it is clicked
         mouseEventDisposables.add 'atom-workspace', 'click', '.tree-view-resizer', (event) => @toggle value is 'click'
+        # hide the tree view when another element is focused
         mouseEventDisposables.add '.tree-view', 'blur', =>
+          # clear the focused element so the user clicked element will be focused
           @clearFocusedElement()
           @hide 0
 

error = (e) ->
  console.error e.message, '\n', e.stack

clone = (obj) ->
  res = {}
  res[key] = obj[key] for own key of obj
  res

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

  activate: ->
    SubAtom ?= require 'sub-atom'
    @disposables = new SubAtom()

    # keep a reference to the package config
    @conf = atom.config.get 'autohide-tree-view'
    {pushEditor} = @conf

