From 1bc53b58751d2bee3224396cc53390e09c86b83c Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 27 Nov 2025 19:30:32 +0100 Subject: [PATCH] refactor: use orelse in CurSel.to_selection --- src/tui/editor.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 35b8c14..f01342f 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -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 {