feat: add Cursor.within predicate function
This commit is contained in:
parent
1d1d828097
commit
5fccffc4b6
1 changed files with 6 additions and 0 deletions
|
|
@ -245,3 +245,9 @@ pub fn nudge_delete(self: *Self, nudge: Selection) bool {
|
|||
self.row -= nudge.end.row - nudge.begin.row;
|
||||
return true;
|
||||
}
|
||||
|
||||
pub fn within(self: *const Self, sel_: Selection) bool {
|
||||
var sel = sel_;
|
||||
sel.normalize();
|
||||
return !sel.begin.right_of(self.*) and sel.end.right_of(self.*);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue