]> git.eshelyaron.com Git - emacs.git/commitdiff
Cover more cases in c-ts-common-comment-indent-new-line
authorYuan Fu <casouri@gmail.com>
Mon, 22 Apr 2024 06:57:09 +0000 (23:57 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 22 Apr 2024 18:38:31 +0000 (20:38 +0200)
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Handle the case for ///, which
is used by rust.

(cherry picked from commit 4d9629b087fe6df941b553c6931b2f8996901e21)

lisp/progmodes/c-ts-common.el

index 732b61bdd8f85c468f0d2fe93cc7f03464595444..735126e1eac5e609f1f62fc06e50ff84f0b8070d 100644 (file)
@@ -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))