feat: add Cursor.within predicate function

This commit is contained in:
CJ van den Berg 2025-11-03 18:29:32 +01:00
parent 1d1d828097
commit 5fccffc4b6
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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.*);
}