diff options
| author | Brian Mastenbrook <brian@mastenbrook.net> | 2016-04-06 13:14:27 -0500 |
|---|---|---|
| committer | Brian Mastenbrook <brian@mastenbrook.net> | 2016-04-06 13:14:27 -0500 |
| commit | a8a5e14544ce3cf9fb9319ece667f8dbe27c1034 (patch) | |
| tree | 97b301c8a407e0640eab81e4062f5caf2c11887a | |
| parent | 917503bf51d936ee0868a377527ff88a8a7a2ac0 (diff) | |
| download | rust-mode-a8a5e14544ce3cf9fb9319ece667f8dbe27c1034.tar.gz | |
Fix for emacs24
| -rw-r--r-- | rust-mode.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/rust-mode.el b/rust-mode.el index bb4d792..647e6b1 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -1058,13 +1058,18 @@ the desired identifiers), but does not match type annotations \"foo::<\"." (let ((result ;; Replace /* with same number of spaces (replace-regexp-in-string - "\\(?:/\\*+\\)[!*]?" + "\\(?:/\\*+?\\)[!*]?" (lambda (s) - ;; We want the * to line up with the first * of the comment start - (concat (make-string (- (length s) - (if (or (string-suffix-p "!" s) - (string-suffix-p "**" s)) 2 1)) - ?\x20) "*")) + ;; We want the * to line up with the first * of the + ;; comment start + (let ((offset (if (eq t + (compare-strings "/*" nil nil + s + (- (length s) 2) + (length s))) + 1 2))) + (concat (make-string (- (length s) offset) + ?\x20) "*"))) line-start))) ;; Make sure we've got at least one space at the end (if (not (= (aref result (- (length result) 1)) ?\x20)) |
