From: Yuan Fu Date: Tue, 23 Apr 2024 23:28:20 +0000 (-0700) Subject: Make c-ts-common--fill-paragraph work for rust line comment X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f5eadf1f9d61d5745262ed4791b4f1c0d5a467d;p=emacs.git 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 //. (cherry picked from commit 67ef1d54e7e3983bb03840cf8f2990d579942710) --- diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index 457aa55c195..c06295b8a87 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el @@ -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)))