[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 6252cf1 217/486: Fix indentation of closing deli
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 6252cf1 217/486: Fix indentation of closing delimiters |
Date: |
Sat, 7 Aug 2021 09:25:22 -0400 (EDT) |
branch: elpa/rust-mode
commit 6252cf188390992c3ea47842e75840fd63c7f6c1
Author: Eivind Fonn <evfonn@gmail.com>
Commit: Eivind Fonn <evfonn@gmail.com>
Fix indentation of closing delimiters
---
rust-mode-tests.el | 19 +++++++++++++++++++
rust-mode.el | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index e41245f..8375d35 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -631,6 +631,25 @@ fn args_on_the_next_line( // with a comment
}
"))
+(ert-deftest indent-closing-square-bracket ()
+ (test-indent
+ "fn blergh() {
+ let list = vec![
+ 1,
+ 2,
+ 3,
+ ];
+}"))
+
+(ert-deftest indent-closing-paren ()
+ (test-indent
+ "fn blergh() {
+ call(
+ a,
+ function
+ );
+}"))
+
(ert-deftest indent-nested-fns ()
(test-indent
"
diff --git a/rust-mode.el b/rust-mode.el
index 4697c70..a1a3db4 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -373,7 +373,7 @@ function or trait. When nil, where will be aligned with fn
or trait."
(+ baseline rust-indent-offset))))
;; A closing brace is 1 level unindented
- ((looking-at "}") (- baseline rust-indent-offset))
+ ((looking-at "[]})]") (- baseline rust-indent-offset))
;; Doc comments in /** style with leading * indent to line up
the *s
((and (nth 4 (syntax-ppss)) (looking-at "*"))
- [nongnu] elpa/rust-mode e16c37c 161/486: Remove Marmalade from the README, (continued)
- [nongnu] elpa/rust-mode e16c37c 161/486: Remove Marmalade from the README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ee171df 172/486: test $EMACS directly rather than using "which", ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d1ed015 173/486: Distinguish face for doc-comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c9c7871 179/486: Merge pull request #79 from MicahChalmer/angle-bracket-madness, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ee564d5 185/486: Merge pull request #85 from talchas/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 99b128c 187/486: Fix slowness in angle bracket matching, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5e77aed 191/486: Correcting highlighting of capitals in function names., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5e51aaa 194/486: Merge pull request #69 from tromey/safe-local-variables, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 012537b 195/486: remove byte-compiler warnings and prevent future ones, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 866df37 196/486: make rust-mode use lexical binding, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6252cf1 217/486: Fix indentation of closing delimiters,
ELPA Syncer <=
- [nongnu] elpa/rust-mode dd6d417 215/486: Fix type annotations incorrectly highlighted as modules., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 86d636a 223/486: Remove duplicate keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b1cca0f 222/486: Merge pull request #72 from birkenfeld/builtin-face, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 061e6d8 214/486: Merge pull request #109 from mrBliss/highlight-unsafe, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 86c55b1 220/486: Integrate rustfmt support, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode beec95a 231/486: Allow disabling rustfmt with a dir-local/file-local variable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6739dd9 226/486: Merge pull request #123 from birkenfeld/fix-unicode-char-escapes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f408b06 227/486: Run the after-revert hook after rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode bc0df03 235/486: Merge pull request #135 from Stebalien/file-local, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9812232 236/486: Document how to install on Debian, ELPA Syncer, 2021/08/07