summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis2022-01-08 15:31:05 +0000
committerGitHub2022-01-08 15:31:05 +0000
commit939261fc078cea86d0e7f712222b9ae22785478c (patch)
tree66bbbbfdf1c69c7f2a2d3ba8cfbddb0d32b1129c
parent5b45bdd80f1b2bd456d247ed6d2d95e9efb9d304 (diff)
expand_selection to current node with no children (#1454)
-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)