[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 6e9db46 331/486: Merge pull request #230 from tr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 6e9db46 331/486: Merge pull request #230 from tromey/fix-indentation-bug |
Date: |
Sat, 7 Aug 2021 09:25:46 -0400 (EDT) |
branch: elpa/rust-mode
commit 6e9db4665036ca6f0fe8eecf55cd243eaebccc62
Merge: e48a650 38f7d89
Author: Tom Tromey <tom@tromey.com>
Commit: GitHub <noreply@github.com>
Merge pull request #230 from tromey/fix-indentation-bug
Fix recognition of "<" as operator in some context
---
rust-mode-tests.el | 11 +++++++++++
rust-mode.el | 3 +++
2 files changed, 14 insertions(+)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 7335334..aab82df 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -2034,6 +2034,17 @@ fn main() {
baz();
}"))
+;; Regression test for #212.
+(ert-deftest indent-left-shift ()
+ (test-indent "
+fn main() {
+ let a = [[0u32, 0u32]; 1];
+ let i = 0;
+ let x = a[i][(1 < i)];
+ let x = a[i][(1 << i)];
+}
+"))
+
(defun rust-test-matching-parens (content pairs &optional nonparen-positions)
"Assert that in rust-mode, given a buffer with the given `content',
emacs's paren matching will find all of the pairs of positions
diff --git a/rust-mode.el b/rust-mode.el
index 1c0921b..ed5b5ed 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -812,6 +812,9 @@ match data if found. Returns nil if not within a Rust
string."
;; it to be an expression.
((and (equal token 'open-brace) (rust-looking-back-macro)) t)
+ ;; In a brace context a "]" introduces an expression.
+ ((and (eq token 'open-brace) (rust-looking-back-str "]")))
+
;; An identifier is right after an ending paren, bracket, angle bracket
;; or curly brace. It's a type if the last sexp was a type.
((and (equal token 'ident) (equal 5 (rust-syntax-class-before-point)))
- [nongnu] elpa/rust-mode 72c479b 311/486: Add `rust-run-clippy' and `rust-buffer-project' with testing paraphernalia., (continued)
- [nongnu] elpa/rust-mode 72c479b 311/486: Add `rust-run-clippy' and `rust-buffer-project' with testing paraphernalia., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 4ec735e 300/486: Add stderr output from rustfmt on exit code 3, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9afe997 313/486: Declare `rust-buffer-project' and require `json' at runtime., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b4077f8 314/486: Add `rust-cargo-bin' custom variable., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d2bb17c 315/486: Skip `rust-test-project-located' without cargo and avoid `find-file' in test., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0985f5f 318/486: Merge pull request #217 from Aankhen/add-clippy-command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 34cc528 319/486: Highlight question mark operator using new `rust-question-mark-face'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2a9fcd0 321/486: Add syntax highlighting and imenu support for `union`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 89320ad 323/486: Highlight interpolation in arguments to print! &c., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e48a650 329/486: Merge pull request #225 from Aankhen/add-var-colours, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6e9db46 331/486: Merge pull request #230 from tromey/fix-indentation-bug,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 0e832ec 340/486: Remove `float`, `int`, and `uint` as built-in types., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 302b537 344/486: Revert #216 and Add Suggestions from #226, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b8e4908 345/486: Merge pull request #243 from iwillspeak/rust-compile-command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6bcb82b 350/486: Merge pull request #249 from brotzeit/rust--format-call, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 705f3e4 352/486: Improved font-locking for print macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2fe1f9d 355/486: add dyn to keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0d408d5 357/486: Merge pull request #253 from jjwest/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 42c98bb 362/486: Merge pull request #263 from nikomatsakis/tweak-compilation-regexp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3613551 365/486: throw error in after-save-hook instead of before-save-hook, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 64b4a24 368/486: Merge pull request #272 from tromey/let-ref-font-lock, ELPA Syncer, 2021/08/07