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

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

[nongnu] elpa/rust-mode 2038365 120/486: Fix bug in rust-indent-method-c


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 2038365 120/486: Fix bug in rust-indent-method-chains
Date: Sat, 7 Aug 2021 09:25:01 -0400 (EDT)

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

    Fix bug in rust-indent-method-chains
---
 rust-mode-tests.el | 9 +++++++++
 rust-mode.el       | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 347dcd2..36e59df 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -1012,3 +1012,12 @@ fn main() {
 }
 "
    )))
+
+(ert-deftest indent-method-chains-after-comment ()
+  (let ((rust-indent-method-chain t)) (test-indent
+   "
+fn main() { // comment here should not push next line out
+    foo.bar()
+}
+"
+   )))
diff --git a/rust-mode.el b/rust-mode.el
index 3413592..43afd9a 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -131,7 +131,7 @@
           ;;
           ((skip-dot-identifier
             (lambda ()
-              (when (looking-back (concat "\." rust-re-ident))
+              (when (looking-back (concat "\\." rust-re-ident))
                 (backward-word 1)
                 (backward-char)
                 (- (current-column) rust-indent-offset)))))



reply via email to

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