fix: don't allow triple click to fail if select_line_at_cursor fails

This commit is contained in:
CJ van den Berg 2025-12-28 21:18:46 +01:00
parent 3de4a47123
commit 1685b3204c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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);
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();
}