on master help sign in
Avoid false positives in non-fuzzy bracket match
commit5dba649d81d706125e16fa695747ed936e7b105a authorPascal Kuthe <pascal.kuthe@semimod.de> dateTue 6 Jun 2023, 01:37 (3 years ago) parent37058e0
1 file changed+4−1
helix-core/src/match_brackets.rs+4−1
helix-core/src/match_brackets.rs+4−1
@@ -64,9 +64,12 @@ fn find_pair(syntax: &Syntax, doc: &Rope, pos: usize, traverse_parents: bool) ->
6464 if end_byte == pos {
6565 return Some(start_char);
6666 }
67+
6768 // We return the end char if the cursor is either on the start char
6869 // or at some arbitrary position between start and end char.
69− return Some(end_char);
70+ if traverse_parents || start_byte == pos {
71+ return Some(end_char);
72+ }
7073 }
7174 }
7275 // this node itselt wasn't a pair but maybe its siblings are