mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 11:23:10 +03:00
expand_selection to current node with no children (#1454)
This commit is contained in:
parent
5b45bdd80f
commit
939261fc07
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user