summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authormrBliss <dewinant@gmail.com>2015-12-01 18:26:00 +0100
committermrBliss <dewinant@gmail.com>2015-12-01 18:26:00 +0100
commita33b684a027b8f5efb1e197d7f3e294d2f271f26 (patch)
tree32209a22db2e17efd48f89324c17a249dc2fcbe6 /rust-mode.el
parent0601540d43b901b0ad0ec62363a143cd3a054364 (diff)
downloadrust-mode-a33b684a027b8f5efb1e197d7f3e294d2f271f26.tar.gz
Fix #103: comment indentation after struct members
Correctly indent comments that come after struct members that do not have a trailing comma. Before: struct A { x: u8 // TOO FAR } After: struct A { x: u8 // CORRECT }
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 5b50d29..bc03023 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -369,7 +369,9 @@
;; baseline as well (we are continuing an expression,
;; but the "else" or "{" should align with the beginning
;; of the expression it's in.)
- (looking-at "\\<else\\>\\|{")
+ ;; Or, if this line starts a comment, stay on the
+ ;; baseline as well.
+ (looking-at "\\<else\\>\\|{\\|/[/*]")
(save-excursion
(rust-rewind-irrelevant)