; Fix comment-end in treesit-simple-indent-presets

* lisp/treesit.el (treesit-simple-indent-presets): Fix comment-end.
This commit is contained in:
Yuan Fu 2022-11-25 14:24:27 -08:00
parent e9f86182ce
commit 73c94d5a9f
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -1053,8 +1053,10 @@ See `treesit-simple-indent-presets'.")
(lambda (node &rest _)
(string-match-p
name (or (treesit-node-field-name node) "")))))
(cons 'comment-end (lambda (&rest _)
(looking-at-p treesit-comment-end)))
(cons 'comment-end (lambda (_node _parent bol &rest _)
(save-excursion
(goto-char bol)
(looking-at-p treesit-comment-end))))
;; TODO: Document.
(cons 'catch-all (lambda (&rest _) t))