fix(emacs-lisp): handle malformed outline-regexp

Sometimes elisp files specify an outline-regexp which does not match any
groups so this causes it to return a default value of 0 instead of an
error.
This commit is contained in:
StrawberryTea
2025-02-08 00:08:28 -05:00
committed by Henrik Lissner
parent 2bceb217d9
commit 90d2834bef

View File

@ -32,7 +32,9 @@ to a pop up buffer."
(defun +emacs-lisp-outline-level ()
"Return outline level for comment at point.
Intended to replace `lisp-outline-level'."
(- (match-end 1) (match-beginning 1)))
(if (match-beginning 1)
(- (match-end 1) (match-beginning 1))
0))
;;