branch: elpa/rust-mode
commit 2038365705131ce73c4511e886f2896fa83b01c4
Author: Micah Chalmer <[email protected]>
Commit: Micah Chalmer <[email protected]>
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)))))