Skip to content

Commit a8a5e14

Browse files
committed
Fix for emacs24
1 parent 917503b commit a8a5e14

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

rust-mode.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,13 +1058,18 @@ 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)
1063-
;; We want the * to line up with the first * of the comment start
1064-
(concat (make-string (- (length s)
1065-
(if (or (string-suffix-p "!" s)
1066-
(string-suffix-p "**" s)) 2 1))
1067-
?\x20) "*"))
1063+
;; We want the * to line up with the first * of the
1064+
;; comment start
1065+
(let ((offset (if (eq t
1066+
(compare-strings "/*" nil nil
1067+
s
1068+
(- (length s) 2)
1069+
(length s)))
1070+
1 2)))
1071+
(concat (make-string (- (length s) offset)
1072+
?\x20) "*")))
10681073
line-start)))
10691074
;; Make sure we've got at least one space at the end
10701075
(if (not (= (aref result (- (length result) 1)) ?\x20))

0 commit comments

Comments
 (0)