feat: make shrink_selection select the node at the cursor if there is no selection
This commit is contained in:
parent
bcef17a466
commit
bfa3ea007c
1 changed files with 2 additions and 1 deletions
|
@ -4386,11 +4386,12 @@ pub const Editor = struct {
|
||||||
const root = try self.buf_root();
|
const root = try self.buf_root();
|
||||||
const cursel = self.get_primary();
|
const cursel = self.get_primary();
|
||||||
cursel.check_selection(root, self.metrics);
|
cursel.check_selection(root, self.metrics);
|
||||||
if (cursel.selection) |_|
|
if (cursel.selection) |_| {
|
||||||
try if (unnamed)
|
try if (unnamed)
|
||||||
self.shrink_selection_to_child_node(root, cursel, self.metrics)
|
self.shrink_selection_to_child_node(root, cursel, self.metrics)
|
||||||
else
|
else
|
||||||
self.shrink_selection_to_named_child_node(root, cursel, self.metrics);
|
self.shrink_selection_to_named_child_node(root, cursel, self.metrics);
|
||||||
|
} else try cursel.select_node(try self.top_node_at_cursel(cursel, root, self.metrics), root, self.metrics);
|
||||||
self.clamp();
|
self.clamp();
|
||||||
try self.send_editor_jump_destination();
|
try self.send_editor_jump_destination();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue