File tree 2 files changed +26
-2
lines changed
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -1668,6 +1668,18 @@ fn main() {
1668
1668
"
1669
1669
)))
1670
1670
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
+
1671
1683
(ert-deftest indent-method-chains-with-align ()
1672
1684
(let ((rust-indent-method-chain t )) (test-indent
1673
1685
"
@@ -1679,6 +1691,18 @@ fn main() {
1679
1691
"
1680
1692
)))
1681
1693
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
+
1682
1706
(ert-deftest indent-method-chains-with-align-and-second-stmt ()
1683
1707
(let ((rust-indent-method-chain t )) (test-indent
1684
1708
"
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ buffer."
320
320
(- (current-column ) rust-indent-offset)))))
321
321
(cond
322
322
; ; foo.bar(...)
323
- ((rust- looking-back-str " ) " )
323
+ ((looking-back " [)?] " ( 1- ( point )) )
324
324
(backward-list 1 )
325
325
(funcall skip-dot-identifier))
326
326
@@ -501,7 +501,7 @@ buffer."
501
501
; ; ..or if the previous line ends with any of these:
502
502
; ; { ? : ( , ; [ }
503
503
; ; then we are at the beginning of an expression, so stay on the baseline...
504
- (looking-back " [(,:;? [{}]\\ |[^|]|" (- (point ) 2 ))
504
+ (looking-back " [(,:;[{}]\\ |[^|]|" (- (point ) 2 ))
505
505
; ; or if the previous line is the end of an attribute, stay at the baseline...
506
506
(progn (rust-rewind-to-beginning-of-current-level-expr) (looking-at " #" )))))
507
507
baseline
You can’t perform that action at this time.
0 commit comments