From d858a6262a156aba37ad3845455a7e8154129914 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 6 Jan 2022 11:38:22 -0600 Subject: [PATCH] expand_selection to current node with no children --- 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 21fa24fb423a..3363e20bcc04 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)