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.
This commit is contained in:
Yuan Fu 2024-04-21 23:57:09 -07:00
parent 419550c790
commit 4d9629b087
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View 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))