Make c-ts-common--fill-paragraph work for rust line comment

* lisp/progmodes/c-ts-common.el (c-ts-common--fill-paragraph): Back to
BOL before checking for //.
This commit is contained in:
Yuan Fu 2024-04-23 16:28:20 -07:00
parent 145a77808e
commit 67ef1d54e7
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -125,6 +125,9 @@ ARG is passed to `fill-paragraph'."
(treesit-node-type node))
(if (save-excursion
(goto-char (treesit-node-start node))
;; In rust, NODE will be the body of a comment excluding
;; the //, so we need to go to BOL to check for //.
(back-to-indentation)
(looking-at "//"))
(fill-comment-paragraph arg)
(c-ts-common--fill-block-comment arg)))