emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode 1962971 044/486: Correct indent with trailing sp


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 1962971 044/486: Correct indent with trailing spaces/comments on previous line
Date: Sat, 7 Aug 2021 09:24:45 -0400 (EDT)

branch: elpa/rust-mode
commit 1962971cb2f2399528ba82897f210fdf3acf3c5e
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>

    Correct indent with trailing spaces/comments on previous line
---
 rust-mode.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index e0f2516..b79d093 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -62,7 +62,8 @@
               ;;  - { means indent to either nesting-level * 
rust-indent-offset,
               ;;    or one further indent from that if either current line
               ;;    begins with 'else', or previous line didn't end in
-              ;;    semi, comma or brace, and wasn't an attribute. PHEW.
+              ;;    semi, comma or brace (other than whitespace and line
+              ;;    comments) , and wasn't an attribute. PHEW.
               ((> level 0)
                (let ((pt (point)))
                  (rust-rewind-irrelevant)
@@ -79,7 +80,7 @@
                          (beginning-of-line)
                          (rust-rewind-irrelevant)
                          (end-of-line)
-                         (if (looking-back "[{};,]")
+                         (if (looking-back "[,;{}][[:space:]]*\\(?://.*\\)?")
                              (* rust-indent-offset level)
                            (back-to-indentation)
                            (if (looking-at "#")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]