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