expand_selection to current node with no children (#1454)
commit939261fc078cea86d0e7f712222b9ae22785478c
authorMichael Davis <mcarsondavis@gmail.com>
dateSat 8 Jan 2022, 09:31 (5 years ago)
parent5b45bdd
helix-core/src/object.rs+1−1
@@ -12,7 +12,7 @@ pub fn expand_selection(syntax: &Syntax, text: RopeSlice, selection: &Selection)
1212 .root_node()
1313 .descendant_for_byte_range(from, to)
1414 .and_then(|node| {
15− if node.child_count() == 0 || (node.start_byte() == from && node.end_byte() == to) {
15+ if node.start_byte() == from && node.end_byte() == to {
1616 node.parent()
1717 } else {
1818 Some(node)