refactor: use orelse in CurSel.to_selection

This commit is contained in:
CJ van den Berg 2025-11-27 19:30:32 +01:00
parent 93f8587881
commit 1bc53b5875
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -121,7 +121,7 @@ pub const CurSel = struct {
}
fn to_selection(self: *const Self) Selection {
return if (self.selection) |sel| sel else Selection.from_cursor(&self.cursor);
return self.selection orelse Selection.from_cursor(&self.cursor);
}
fn to_selection_inclusive(self: *const Self, root: Buffer.Root, metrics: Buffer.Metrics) Selection {