From 4d9629b087fe6df941b553c6931b2f8996901e21 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sun, 21 Apr 2024 23:57:09 -0700 Subject: [PATCH] Cover more cases in c-ts-common-comment-indent-new-line * lisp/progmodes/c-ts-common.el: (c-ts-common-comment-indent-new-line): Handle the case for ///, which is used by rust. --- lisp/progmodes/c-ts-common.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index 732b61bdd8f..735126e1eac 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el @@ -292,10 +292,10 @@ and /* */ comments. SOFT works the same as in ;; line is in a /* comment, insert a newline and a * prefix. No ;; auto-fill or other smart features. (cond - ;; Line starts with // + ;; Line starts with //, or ///, or ////... ((save-excursion (beginning-of-line) - (looking-at (rx "//" (group (* " "))))) + (looking-at (rx "//" (group (* "/") (* " "))))) (let ((whitespaces (match-string 1))) (if soft (insert-and-inherit ?\n) (newline 1)) (delete-region (line-beginning-position) (point))