summaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/object.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/object.rs b/helix-core/src/object.rs
index 21fa24fb..3363e20b 100644
--- a/helix-core/src/object.rs
+++ b/helix-core/src/object.rs
@@ -12,7 +12,7 @@ pub fn expand_selection(syntax: &Syntax, text: RopeSlice, selection: &Selection)
.root_node()
.descendant_for_byte_range(from, to)
.and_then(|node| {
- if node.child_count() == 0 || (node.start_byte() == from && node.end_byte() == to) {
+ if node.start_byte() == from && node.end_byte() == to {
node.parent()
} else {
Some(node)