Skip to content

Commit 59e7dce

Browse files
committed
Avoid false positives in non-fuzzy bracket match
1 parent 40c45f7 commit 59e7dce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

helix-core/src/match_brackets.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)