From 1685b3204c3edcc9d9ea146cb06fb173743b4b6c Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 28 Dec 2025 21:18:46 +0100 Subject: [PATCH] fix: don't allow triple click to fail if select_line_at_cursor fails --- src/tui/editor.zig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 95fbd82..f4be723 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2636,8 +2636,15 @@ pub const Editor = struct { primary.disable_selection(root, self.metrics); self.selection_mode = .line; primary.cursor.move_abs(root, &self.view, @intCast(y), @intCast(x), self.metrics) catch return; - try self.select_line_at_cursor(root, primary, .exclude_eol); - self.selection_drag_initial = primary.selection; + blk: { + self.select_line_at_cursor(root, primary, .exclude_eol) catch |e| switch (e) { + error.Stop => { + self.selection_drag_initial = primary.to_selection_normal(); + break :blk; + }, + }; + self.selection_drag_initial = primary.selection; + } self.collapse_cursors(); self.clamp_mouse(); }