feat: add Match.from_pos function
This commit is contained in:
parent
65eb6bc7ad
commit
10bd270d89
1 changed files with 4 additions and 0 deletions
|
@ -74,6 +74,10 @@ pub const Match = struct {
|
|||
return .{ .begin = self.begin, .end = self.end };
|
||||
}
|
||||
|
||||
pub fn from_pos(self: Self, root: Buffer.Root, metrics: Buffer.Metrics) error{NotFound}!Self {
|
||||
return from_selection(try self.to_selection().from_pos(root, metrics));
|
||||
}
|
||||
|
||||
fn nudge_insert(self: *Self, nudge: Selection) void {
|
||||
self.begin.nudge_insert(nudge);
|
||||
self.end.nudge_insert(nudge);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue