about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-10-14 11:50:14 +0000
committerGitHub <noreply@github.com>2021-10-14 11:50:14 +0000
commit8619058d3da8b1cc40dd1eb18e5643577b6a9492 (patch)
treeb2353e98cf73c31d3893722d272f89182d6f1207 /src/test/codegen/src-hash-algorithm
parentc5354877c98bf804eaa6148204386dd392eb3b39 (diff)
parent7e68db3670cf7490e8ae825de346910b1657f4f1 (diff)
downloadrust-8619058d3da8b1cc40dd1eb18e5643577b6a9492.tar.gz
rust-8619058d3da8b1cc40dd1eb18e5643577b6a9492.zip
Merge #10538
10538: fix: matching brace should prefer brace on cursor's right r=Veykril a=codgician

I observed a brace matching issue with the following Rust code:

```rust
let x = (1 + (2 + 3)) * 4;
```

In a situation like `<|>(1 + (2 + 3)) * 4`, the cursor will go to `(1 + (2 + 3)<|>) * 4`, and if user tries to match bracket again it will go like  `(1 + <|>(2 + 3)) * 4` while logically the expected result should be `<|>(1 + (2 + 3)) * 4`. This behavior exists in both line cursor style and block cursor style.

This PR fixes this by letting `matching_brace` prefer the brace to cursor's right when the cursor lies between multiple consecutive braces. It **does NOT** fix #1942 but could be related. Please review.


Co-authored-by: codgician <15964984+codgician@users.noreply.github.com>
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions