[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 92584c3 209/486: Fix the special case for the fi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 92584c3 209/486: Fix the special case for the first line |
Date: |
Sat, 7 Aug 2021 09:25:20 -0400 (EDT) |
branch: elpa/rust-mode
commit 92584c303acc417501d1faa593ff1392fd306c1d
Author: mrBliss <dewinant@gmail.com>
Commit: mrBliss <dewinant@gmail.com>
Fix the special case for the first line
This special case broke indentation of `where` clauses.
---
rust-mode-tests.el | 11 +++++++++++
rust-mode.el | 7 ++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index e224e67..cc76007 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -603,6 +603,17 @@ impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K,
V, S>
}
"))
+(ert-deftest indent-align-where-clauses-first-line ()
+ (test-indent
+ "fn foo1(a: A, b: B) -> A
+ where A: Clone + Default, B: Eq {
+ let body;
+ Foo {
+ bar: 3
+ }
+}
+"))
+
(ert-deftest indent-square-bracket-alignment ()
(test-indent
"
diff --git a/rust-mode.el b/rust-mode.el
index d857f25..6b09580 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -444,10 +444,11 @@ function or trait. When nil, where will be aligned with
fn or trait."
(save-excursion
(rust-rewind-irrelevant)
- ;; Point is now at the end of the previous ine
+ ;; Point is now at the end of the previous line
(or
- ;; If we are at the first line, no indentation is
needed, so stay at baseline...
- (= 1 (line-number-at-pos (point)))
+ ;; If we are at the start of the buffer, no
+ ;; indentation is needed, so stay at baseline...
+ (= (point) 1)
;; ..or if the previous line ends with any of these:
;; { ? : ( , ; [ }
;; then we are at the beginning of an expression, so
stay on the baseline...
- [nongnu] elpa/rust-mode 4e938b1 164/486: Merge pull request #63 from krig/panic-compilation-warning, (continued)
- [nongnu] elpa/rust-mode 4e938b1 164/486: Merge pull request #63 from krig/panic-compilation-warning, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f17e11a 162/486: Match panics during build as compilation warnings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b4ff35c 168/486: remove rust-mode-character-literal-syntax-table, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5ed4675 171/486: Merge pull request #73 from MicahChalmer/raw-string-multiline-edit-fix, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9d773b4 170/486: Fix multi-line raw strings when editing, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6bc1540 186/486: Support nested block comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7baae9c 180/486: Merge pull request #78 from tromey/fix-issue-33, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c0e3878 183/486: Merge pull request #81 from MicahChalmer/fix-issue-80, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 75da3b0 189/486: Merge pull request #89 from MicahChalmer/fix-slow-angle-bracket-matching, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a2e9f56 199/486: Merge pull request #84 from birkenfeld/compilation-note, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 92584c3 209/486: Fix the special case for the first line,
ELPA Syncer <=
- [nongnu] elpa/rust-mode b76e803 208/486: Correctly indent where clauses, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 304ae4b 219/486: Change font-lock face for module names., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ae49380 221/486: Merge pull request #121 from fbergroth/integrate-rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 315cc59 233/486: Re-indent on }, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode bc77e16 240/486: remove emacs 23 support, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 620d718 257/486: Fix #160, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode cffb950f2 258/486: [master] Remove redundant progn., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b3b0f78 259/486: Merge pull request #161 from Fanael/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ba5ff90 260/486: Merge pull request #159 from hotpxl/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f73f321 264/486: Merge pull request #163 from Wilfred/preserve_point_rustfmt, ELPA Syncer, 2021/08/07