Function: treemacs-indent-guide-mode

treemacs-indent-guide-mode is an interactive and byte-compiled function defined in treemacs-visuals.el.

Signature

(treemacs-indent-guide-mode &optional ARG)

Documentation

Toggle treemacs-indent-guide-mode(var)/treemacs-indent-guide-mode(fun).

When enabled treemacs will show simple indent guides for its folder structure. The effect is achieved by overriding the values of treemacs-indentation and treemacs-indentation-string. Disabling the mode will restore the previously used settings.

This is a global minor mode. If called interactively, toggle the Treemacs-Indent-Guide mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=treemacs-indent-guide-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-visuals.el
(define-minor-mode treemacs-indent-guide-mode
  "Toggle `treemacs-indent-guide-mode'.
When enabled treemacs will show simple indent guides for its folder structure.
The effect is achieved by overriding the values of `treemacs-indentation' and
`treemacs-indentation-string'.  Disabling the mode will restore the previously
used settings."
  :init-value nil
  :global     t
  :lighter    nil
  :group      'treemacs
  (if treemacs-indent-guide-mode
      (progn
        (setf
         treemacs--saved-indent-settings
         (cons treemacs-indentation treemacs-indentation-string)
         treemacs-indentation 1
         treemacs-indentation-string
         (pcase-exhaustive treemacs-indent-guide-style
           ('line  (propertize " ┃ " 'face 'font-lock-comment-face))
           ('block (list
                    "  "
                    (propertize "██" 'face 'font-lock-comment-face))))))
    (setf treemacs-indentation (car treemacs--saved-indent-settings)
          treemacs-indentation-string (cdr treemacs--saved-indent-settings)))
  (treemacs-without-messages
   (treemacs-run-in-every-buffer
    (treemacs--do-refresh (current-buffer) 'all))))