fix(fold): Use function variables over direct func

Replace direct calls to `hs-looking-at-block-start-p` and
`hs-find-block-beginning` with their corresponding function variables to
ensure compatibility with hideshow mode's configurable function
handling.

These function variables are set in [`treesit` in Emacs 31][1]. It broke
fold because `hs-block-start-regexp` is set to `nil` explicitly by
treesit overrides.

The default for `hs-looking-at-block-start-p-func` and
`hs-find-block-beginning-func` are same as what was being called before.

Ref:
[1]: 2e3b085d44
This commit is contained in:
Prashant Vithani
2025-06-30 17:05:18 +00:00
committed by DoomBot
parent adf5594c3c
commit 6010b40247

View File

@ -35,8 +35,8 @@ Return non-nil if successful in doing so."
(when (+fold--ensure-hideshow-mode)
(save-excursion
(ignore-errors
(or (hs-looking-at-block-start-p)
(hs-find-block-beginning)
(or (funcall hs-looking-at-block-start-p-func)
(funcall hs-find-block-beginning-func)
(unless (eolp)
(end-of-line)
(+fold--hideshow-fold-p)))))))