Make mhtml-ts-mode--treesit-indent-rules a function
* lisp/textmodes/mhtml-ts-mode.el: (mhtml-ts-mode--treesit-indent-rules): Turn into a function. (mhtml-ts-mode): Update accordingly.
This commit is contained in:
parent
15d2fc6498
commit
77c7ba7fac
1 changed files with 6 additions and 2 deletions
|
@ -315,7 +315,10 @@ NODE and PARENT are ignored."
|
|||
(defun ,(regexp-opt (list css--treesit-defun-type-regexp)))))
|
||||
"Settings for `treesit-thing-settings'.")
|
||||
|
||||
(defvar mhtml-ts-mode--treesit-indent-rules
|
||||
;; We use a function instead of a variable, because doesn't exist when
|
||||
;; at compile time (unless we `eval-when-compile').
|
||||
(defun mhtml-ts-mode--treesit-indent-rules ()
|
||||
"Return intent rules for `mhtml-ts-mode'."
|
||||
(treesit--indent-rules-optimize
|
||||
(append html-ts-mode--indent-rules
|
||||
;; Extended rules for js and css, to
|
||||
|
@ -535,7 +538,8 @@ Powered by tree-sitter."
|
|||
;; `mhtml-ts-mode-tag-relative-indent' and can be used to indent
|
||||
;; JavaScript and CSS code relative to the HTML that contains them,
|
||||
;; just like in mhtml-mode.
|
||||
(setq-local treesit-simple-indent-rules mhtml-ts-mode--treesit-indent-rules)
|
||||
(setq-local treesit-simple-indent-rules
|
||||
(mhtml-ts-mode--treesit-indent-rules))
|
||||
|
||||
;; Navigation.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue