Avoid false positives in non-fuzzy bracket match
This commit is contained in:
parent
37058e0401
commit
5dba649d81
1 changed files with 4 additions and 1 deletions
|
@ -64,9 +64,12 @@ fn find_pair(syntax: &Syntax, doc: &Rope, pos: usize, traverse_parents: bool) ->
|
|||
if end_byte == pos {
|
||||
return Some(start_char);
|
||||
}
|
||||
|
||||
// We return the end char if the cursor is either on the start char
|
||||
// or at some arbitrary position between start and end char.
|
||||
return Some(end_char);
|
||||
if traverse_parents || start_byte == pos {
|
||||
return Some(end_char);
|
||||
}
|
||||
}
|
||||
}
|
||||
// this node itselt wasn't a pair but maybe its siblings are
|
||||
|
|
Loading…
Add table
Reference in a new issue