Function: treesit-fold-mode

treesit-fold-mode is an interactive and natively compiled function defined in treesit-fold.el.

Signature

(treesit-fold-mode &optional ARG)

Documentation

Folding code using tree sitter.

This is a minor mode. If called interactively, toggle the Treesit-Fold 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 the variable treesit-fold-mode(var)/treesit-fold-mode(fun).

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

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/mpy1l6b4hlzpp59l4vbahq83hqa821ci-emacs-packages-deps/share/emacs/site-lisp/elpa/treesit-fold-0.2.1/treesit-fold.el
;;;###autoload
(define-minor-mode treesit-fold-mode
  "Folding code using tree sitter."
  :group 'treesit-fold
  :init-value nil
  :lighter " Treesit-Fold"
  :keymap treesit-fold-mode-map
  (cond
   ((not (and (treesit-available-p)
              (treesit-parser-list)
              (treesit-fold-usable-mode-p)))
    (when treesit-fold-mode
      (treesit-fold-mode -1)))
   (treesit-fold-mode
    (treesit-fold--enable) t)
   (t
    (treesit-fold--disable))))