diff options
| -rw-r--r-- | lisp/progmodes/c-ts-common.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index c06295b8a87..cc8254c5701 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el | |||
| @@ -296,9 +296,10 @@ and /* */ comments. SOFT works the same as in | |||
| 296 | ;; auto-fill or other smart features. | 296 | ;; auto-fill or other smart features. |
| 297 | (cond | 297 | (cond |
| 298 | ;; Line starts with //, or ///, or ////... | 298 | ;; Line starts with //, or ///, or ////... |
| 299 | ;; Or //! (used in rust). | ||
| 299 | ((save-excursion | 300 | ((save-excursion |
| 300 | (beginning-of-line) | 301 | (beginning-of-line) |
| 301 | (looking-at (rx "//" (group (* "/") (* " "))))) | 302 | (looking-at (rx "//" (group (* (any "/!")) (* " "))))) |
| 302 | (let ((whitespaces (match-string 1))) | 303 | (let ((whitespaces (match-string 1))) |
| 303 | (if soft (insert-and-inherit ?\n) (newline 1)) | 304 | (if soft (insert-and-inherit ?\n) (newline 1)) |
| 304 | (delete-region (line-beginning-position) (point)) | 305 | (delete-region (line-beginning-position) (point)) |
| @@ -316,7 +317,7 @@ and /* */ comments. SOFT works the same as in | |||
| 316 | ;; Line starts with *. | 317 | ;; Line starts with *. |
| 317 | ((save-excursion | 318 | ((save-excursion |
| 318 | (beginning-of-line) | 319 | (beginning-of-line) |
| 319 | (looking-at (rx (group (* " ") (or "*" "|") (* " "))))) | 320 | (looking-at (rx (group (* " ") (any "*|") (* " "))))) |
| 320 | (let ((prefix (match-string 1))) | 321 | (let ((prefix (match-string 1))) |
| 321 | (if soft (insert-and-inherit ?\n) (newline 1)) | 322 | (if soft (insert-and-inherit ?\n) (newline 1)) |
| 322 | (delete-region (line-beginning-position) (point)) | 323 | (delete-region (line-beginning-position) (point)) |