File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -1668,6 +1668,18 @@ fn main() {
16681668"
16691669 )))
16701670
1671+ (ert-deftest indent-method-chains-no-align-with-question-mark-operator ()
1672+ (let ((rust-indent-method-chain nil )) (test-indent
1673+ "
1674+ fn main() {
1675+ let x = thing.do_it()
1676+ .aligned()
1677+ .more_alignment()?
1678+ .more_alignment();
1679+ }
1680+ "
1681+ )))
1682+
16711683(ert-deftest indent-method-chains-with-align ()
16721684 (let ((rust-indent-method-chain t )) (test-indent
16731685 "
@@ -1679,6 +1691,18 @@ fn main() {
16791691"
16801692 )))
16811693
1694+ (ert-deftest indent-method-chains-with-align-with-question-mark-operator ()
1695+ (let ((rust-indent-method-chain t )) (test-indent
1696+ "
1697+ fn main() {
1698+ let x = thing.do_it()
1699+ .aligned()
1700+ .more_alignment()?
1701+ .more_alignment();
1702+ }
1703+ "
1704+ )))
1705+
16821706(ert-deftest indent-method-chains-with-align-and-second-stmt ()
16831707 (let ((rust-indent-method-chain t )) (test-indent
16841708 "
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ buffer."
320320 (- (current-column ) rust-indent-offset)))))
321321 (cond
322322 ; ; foo.bar(...)
323- ((rust- looking-back-str " ) " )
323+ ((looking-back " [)?] " ( 1- ( point )) )
324324 (backward-list 1 )
325325 (funcall skip-dot-identifier))
326326
@@ -501,7 +501,7 @@ buffer."
501501 ; ; ..or if the previous line ends with any of these:
502502 ; ; { ? : ( , ; [ }
503503 ; ; then we are at the beginning of an expression, so stay on the baseline...
504- (looking-back " [(,:;? [{}]\\ |[^|]|" (- (point ) 2 ))
504+ (looking-back " [(,:;[{}]\\ |[^|]|" (- (point ) 2 ))
505505 ; ; or if the previous line is the end of an attribute, stay at the baseline...
506506 (progn (rust-rewind-to-beginning-of-current-level-expr) (looking-at " #" )))))
507507 baseline
You can’t perform that action at this time.
0 commit comments