Skip to content

Commit 2038365

Browse files
committed
Fix bug in rust-indent-method-chains
1 parent f3e8f20 commit 2038365

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

rust-mode-tests.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,3 +1012,12 @@ fn main() {
10121012
}
10131013
"
10141014
)))
1015+
1016+
(ert-deftest indent-method-chains-after-comment ()
1017+
(let ((rust-indent-method-chain t)) (test-indent
1018+
"
1019+
fn main() { // comment here should not push next line out
1020+
foo.bar()
1021+
}
1022+
"
1023+
)))

rust-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
;;
132132
((skip-dot-identifier
133133
(lambda ()
134-
(when (looking-back (concat "\." rust-re-ident))
134+
(when (looking-back (concat "\\." rust-re-ident))
135135
(backward-word 1)
136136
(backward-char)
137137
(- (current-column) rust-indent-offset)))))

0 commit comments

Comments
 (0)