feat: add CurSel.merge function

This commit is contained in:
CJ van den Berg 2025-11-03 18:30:45 +01:00
parent 1f3419ec94
commit 1c96a45822
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -242,6 +242,16 @@ pub const CurSel = struct {
return false;
return self.cursor.nudge_delete(nudge);
}
fn merge(self: *Self, other: Selection) bool {
if (self.selection) |*sel_| {
if (sel_.merge(other)) {
self.cursor = sel_.end;
return true;
}
}
return self.cursor.within(other);
}
};
pub const Diagnostic = struct {