File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2034,6 +2034,17 @@ fn main() {
2034
2034
baz();
2035
2035
}" ))
2036
2036
2037
+ ; ; Regression test for #212.
2038
+ (ert-deftest indent-left-shift ()
2039
+ (test-indent "
2040
+ fn main() {
2041
+ let a = [[0u32, 0u32]; 1];
2042
+ let i = 0;
2043
+ let x = a[i][(1 < i)];
2044
+ let x = a[i][(1 << i)];
2045
+ }
2046
+ " ))
2047
+
2037
2048
(defun rust-test-matching-parens (content pairs &optional nonparen-positions )
2038
2049
" Assert that in rust-mode, given a buffer with the given `content' ,
2039
2050
emacs's paren matching will find all of the pairs of positions
Original file line number Diff line number Diff line change @@ -812,6 +812,9 @@ match data if found. Returns nil if not within a Rust string."
812
812
; ; it to be an expression.
813
813
((and (equal token 'open-brace ) (rust-looking-back-macro)) t )
814
814
815
+ ; ; In a brace context a "]" introduces an expression.
816
+ ((and (eq token 'open-brace ) (rust-looking-back-str " ]" )))
817
+
815
818
; ; An identifier is right after an ending paren, bracket, angle bracket
816
819
; ; or curly brace. It's a type if the last sexp was a type.
817
820
((and (equal token 'ident ) (equal 5 (rust-syntax-class-before-point)))
You can’t perform that action at this time.
0 commit comments