summaryrefslogtreecommitdiff
path: root/lisp/textmodes/html-ts-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes/html-ts-mode.el')
-rw-r--r--lisp/textmodes/html-ts-mode.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el
index 301f3e8791c..235e1055fa9 100644
--- a/lisp/textmodes/html-ts-mode.el
+++ b/lisp/textmodes/html-ts-mode.el
@@ -121,8 +121,21 @@ Return nil if there is no name or if NODE is not a defun node."
;; Imenu.
(setq-local treesit-simple-imenu-settings
'(("Element" "\\`tag_name\\'" nil nil)))
+
+ ;; Outline minor mode.
+ (setq-local treesit-outline-predicate "\\`element\\'")
+ ;; `html-ts-mode' inherits from `html-mode' that sets
+ ;; regexp-based outline variables. So need to restore
+ ;; the default values of outline variables to be able
+ ;; to use `treesit-outline-predicate' above.
+ (kill-local-variable 'outline-regexp)
+ (kill-local-variable 'outline-heading-end-regexp)
+ (kill-local-variable 'outline-level)
+
(treesit-major-mode-setup))
+(derived-mode-add-parents 'html-ts-mode '(html-mode))
+
(if (treesit-ready-p 'html)
(add-to-list 'auto-mode-alist '("\\.html\\'" . html-ts-mode)))