From 79369bf2ca8b84e4f7f9b1e843cc124ab6fea861 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 3 Nov 2025 18:31:27 +0100 Subject: [PATCH] fix: also collapse cursors during mouse operations --- src/tui/editor.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index db5a46f..11dff59 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2412,6 +2412,7 @@ pub const Editor = struct { self.selection_mode = .char; try self.send_editor_jump_source(); primary.cursor.move_abs(root, &self.view, @intCast(y), @intCast(x), self.metrics) catch return; + self.collapse_cursors(); self.clamp_mouse(); try self.send_editor_jump_destination(); if (self.jump_mode) try self.goto_definition(.{}); @@ -2425,6 +2426,7 @@ pub const Editor = struct { 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.collapse_cursors(); self.clamp_mouse(); } @@ -2436,6 +2438,7 @@ pub const Editor = struct { 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; + self.collapse_cursors(); self.clamp_mouse(); } @@ -2473,6 +2476,7 @@ pub const Editor = struct { } primary.cursor = sel.end; primary.check_selection(root, self.metrics); + self.collapse_cursors(); self.clamp_mouse(); }