From 939261fc078cea86d0e7f712222b9ae22785478c Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 8 Jan 2022 09:31:05 -0600 Subject: [PATCH] expand_selection to current node with no children (#1454) --- helix-core/src/object.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-core/src/object.rs b/helix-core/src/object.rs index 21fa24fb4..3363e20bc 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)