Skip to content

Commit 917503b

Browse files
committed
Fix failing tests, and add a test for the fix.
1 parent c3feac1 commit 917503b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

rust-mode-tests.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ Also, the result should be the same regardless of whether the code is at the beg
164164
//
165165
// This is the second really really really really really really long paragraph" 1 89))
166166

167+
(ert-deftest fill-paragraph-multi-line-style-comment ()
168+
(test-fill-paragraph
169+
"/* This is a very very very very very very very very long string
170+
*/"
171+
"/* This is a very very very very
172+
* very very very very long
173+
* string
174+
*/"))
175+
167176
(ert-deftest fill-paragraph-multi-line-style-inner-doc-comment ()
168177
(test-fill-paragraph
169178
"/*! This is a very very very very very very very long string

rust-mode.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,13 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
10581058
(let ((result
10591059
;; Replace /* with same number of spaces
10601060
(replace-regexp-in-string
1061-
"\\(?:/\\*+\\)"
1061+
"\\(?:/\\*+\\)[!*]?"
10621062
(lambda (s)
10631063
;; We want the * to line up with the first * of the comment start
1064-
(concat (make-string (- (length s) 1) ?\x20) "*"))
1064+
(concat (make-string (- (length s)
1065+
(if (or (string-suffix-p "!" s)
1066+
(string-suffix-p "**" s)) 2 1))
1067+
?\x20) "*"))
10651068
line-start)))
10661069
;; Make sure we've got at least one space at the end
10671070
(if (not (= (aref result (- (length result) 1)) ?\x20))

0 commit comments

Comments
 (0)