Skip to content

Commit 6252cf1

Browse files
committed
Fix indentation of closing delimiters
1 parent 2cd3cf9 commit 6252cf1

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

rust-mode-tests.el

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,25 @@ fn args_on_the_next_line( // with a comment
631631
}
632632
"))
633633

634+
(ert-deftest indent-closing-square-bracket ()
635+
(test-indent
636+
"fn blergh() {
637+
let list = vec![
638+
1,
639+
2,
640+
3,
641+
];
642+
}"))
643+
644+
(ert-deftest indent-closing-paren ()
645+
(test-indent
646+
"fn blergh() {
647+
call(
648+
a,
649+
function
650+
);
651+
}"))
652+
634653
(ert-deftest indent-nested-fns ()
635654
(test-indent
636655
"

rust-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ function or trait. When nil, where will be aligned with fn or trait."
373373
(+ baseline rust-indent-offset))))
374374

375375
;; A closing brace is 1 level unindented
376-
((looking-at "}") (- baseline rust-indent-offset))
376+
((looking-at "[]})]") (- baseline rust-indent-offset))
377377

378378
;; Doc comments in /** style with leading * indent to line up the *s
379379
((and (nth 4 (syntax-ppss)) (looking-at "*"))

0 commit comments

Comments
 (0)