[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 95d089c 211/486: Merge pull request #110 from mr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 95d089c 211/486: Merge pull request #110 from mrBliss/fix-103 |
Date: |
Sat, 7 Aug 2021 09:25:20 -0400 (EDT) |
branch: elpa/rust-mode
commit 95d089cbc3a23c0dd23869e716520c31daefdf8f
Merge: eaf95af a33b684
Author: Niko Matsakis <niko@alum.mit.edu>
Commit: Niko Matsakis <niko@alum.mit.edu>
Merge pull request #110 from mrBliss/fix-103
Fix #103
---
rust-mode-tests.el | 18 ++++++++++++++++++
rust-mode.el | 4 +++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index cc76007..cbfde96 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -771,6 +771,24 @@ fn foo() {
"
))
+;; This is a test for #103: a comment after the last struct member that does
+;; not have a trailing comma. The comment used to be indented one stop too
+;; far.
+(ert-deftest indent-comment-after-last-struct-member ()
+ (test-indent
+ "
+struct A {
+ x: u8
+ // comment
+}
+
+struct A {
+ x: u8
+ /* comment */
+}
+"
+ ))
+
(setq rust-test-motion-string
"
fn fn1(arg: int) -> bool {
diff --git a/rust-mode.el b/rust-mode.el
index 6b09580..1d39a54 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -440,7 +440,9 @@ function or trait. When nil, where will be aligned with fn
or trait."
;; baseline as well (we are continuing an expression,
;; but the "else" or "{" should align with the beginning
;; of the expression it's in.)
- (looking-at "\\<else\\>\\|{")
+ ;; Or, if this line starts a comment, stay on the
+ ;; baseline as well.
+ (looking-at "\\<else\\>\\|{\\|/[/*]")
(save-excursion
(rust-rewind-irrelevant)
- [nongnu] elpa/rust-mode cdaf3fc 201/486: Update MELPA URL, (continued)
- [nongnu] elpa/rust-mode cdaf3fc 201/486: Update MELPA URL, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1761a9c 204/486: Merge pull request #105 from MicahChalmer/remove-misc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f8d94cb 229/486: Use catch and throw instead of block and return, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 40c33fd 250/486: add code to handle new-style rustc errors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c69adaf 254/486: Add menu titles for items in imenu, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode dae5af7 298/486: Merge pull request #198 from tromey/indentation-fix, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode bfe4056 452/486: Re-implement rust-in-macro for performance, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode eaf95af 210/486: Merge pull request #111 from mrBliss/where-indentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2540d7e 262/486: Go back to the current line and column after formatting., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 52870b6 203/486: Remove unused require of misc.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 95d089c 211/486: Merge pull request #110 from mrBliss/fix-103,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 00e5366 224/486: Merge pull request #122 from kraai/remove-duplicate-keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0601540 205/486: Merge pull request #96 from MicahChalmer/add-licenses, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1492106 232/486: Fix hook args for after-revert-hook, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2f42da8 228/486: Add rust-promote-module-into-dir, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0914b48 234/486: Merge pull request #133 from kraai/avoid-cl, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 917503b 244/486: Fix failing tests, and add a test for the fix., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a8a5e14 245/486: Fix for emacs24, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ed0b390 246/486: Merge pull request #148 from bmastenbrook/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b971c6d 247/486: Fix #151, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode abadab0 009/486: Update rust-mode.el with new keywords., ELPA Syncer, 2021/08/07