     if autofold
       @debugMessage('fold functions: start autofolding')
       @fold('autofold', editor)
-      return true
-    false
+      @debugMessage('fold functions: autofolded')
+      autofold = true
+    autofold
 
   # Figure out the number of functions in this file.
   count: (editor) ->

      editor = atom.workspace.getActiveTextEditor()

    if not editor
      @debugMessage('fold functions: ’no editor, skipping')
      return

    @debugMessage('fold functions: action=', action)
    @indentLevel = @indentLevel || null

    lines = foldableLines = fold = unfold = toggle = 0
    bufferHasFoldableLines = false
    for row in [0..editor.getLastBufferRow()]
      foldable = editor.isFoldableAtBufferRow row
      isFolded = editor.isFoldedAtBufferRow row
      isCommented = editor.isBufferRowCommented row

      bufferHasFoldableLines = true if foldable

