Function: treesit-fold--format-overlay-text
treesit-fold--format-overlay-text is a natively compiled function
defined in treesit-fold.el.
Signature
(treesit-fold--format-overlay-text BEG END)
Documentation
Return the text to display in the overlay for the fold from BEG to END.
Source Code
;; Defined in /nix/store/mpy1l6b4hlzpp59l4vbahq83hqa821ci-emacs-packages-deps/share/emacs/site-lisp/elpa/treesit-fold-0.2.1/treesit-fold.el
;;
;; (@* "Overlays" )
;;
(defun treesit-fold--format-overlay-text (beg end)
"Return the text to display in the overlay for the fold from BEG to END."
(let ((summary (and treesit-fold-summary-show
(treesit-fold-summary--get (buffer-substring beg end)))))
(cond
;; Handle line count display.
((when-let*
((line-count (and treesit-fold-line-count-show
(count-lines beg end)))
(line-count-str (format treesit-fold-line-count-format line-count)))
(concat (or summary "") line-count-str)))
;; `summary' handles truncation itself; just return it if not nil.
(summary )
;; Fallback to ellipsis.
(t (truncate-string-ellipsis)))))