mirror of
https://github.com/helix-editor/helix.git
synced 2024-08-17 06:40:47 +03:00
fix match bracket matching (#10777)
This commit is contained in:
parent
889bbefeb3
commit
2301430e37
@ -87,13 +87,13 @@ fn find_pair(
|
||||
(as_char(doc, &open), as_char(doc, &close))
|
||||
{
|
||||
if PAIRS.contains(&(open, close)) {
|
||||
if start_pos == pos_ {
|
||||
if end_pos == pos_ {
|
||||
return Some(start_pos);
|
||||
}
|
||||
|
||||
// We return the end char if the cursor is either on the start char
|
||||
// or at some arbitrary position between start and end char.
|
||||
if traverse_parents || end_pos == pos_ {
|
||||
if traverse_parents || start_pos == pos_ {
|
||||
return Some(end_pos);
|
||||
}
|
||||
}
|
||||
|
@ -895,6 +895,22 @@ fn foo() {
|
||||
}
|
||||
"##},
|
||||
),
|
||||
// named node with 2 or more children
|
||||
(
|
||||
indoc! {r##"
|
||||
use a::#[{|]#
|
||||
b::{c, d, e, f, g},
|
||||
h, i, j, k, l, m, n,
|
||||
};
|
||||
"##},
|
||||
"mm",
|
||||
indoc! {r##"
|
||||
use a::{
|
||||
b::{c, d, e, f, g},
|
||||
h, i, j, k, l, m, n,
|
||||
#[}|]#;
|
||||
"##},
|
||||
),
|
||||
];
|
||||
|
||||
let python_tests = vec![
|
||||
|
Loading…
Reference in New Issue
Block a user