aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorGokul Soumya2022-01-09 05:08:58 +0000
committerGokul Soumya2022-01-09 05:08:58 +0000
commitb3b4e78585d6a458954b8cb5b2c2a271a78b730b (patch)
tree4253fadc0dd035ac82c139adfc07927925f622fe /helix-core
parent449624965b05fd2abc9e3ba2f791f8de8b1eeb3e (diff)
parent97e12f5c5a26cbbc2eddffd91a2e506403d4d453 (diff)
Merge branch 'master' into cursor-shape-new
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)