From a33b684a027b8f5efb1e197d7f3e294d2f271f26 Mon Sep 17 00:00:00 2001 From: mrBliss Date: Tue, 1 Dec 2015 18:26:00 +0100 Subject: 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 } --- rust-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rust-mode.el') 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 "\\\\|{") + ;; Or, if this line starts a comment, stay on the + ;; baseline as well. + (looking-at "\\\\|{\\|/[/*]") (save-excursion (rust-rewind-irrelevant) -- cgit v1.2.3