fix: don't allow triple click to fail if select_line_at_cursor fails
This commit is contained in:
parent
3de4a47123
commit
1685b3204c
1 changed files with 9 additions and 2 deletions
|
|
@ -2636,8 +2636,15 @@ pub const Editor = struct {
|
||||||
primary.disable_selection(root, self.metrics);
|
primary.disable_selection(root, self.metrics);
|
||||||
self.selection_mode = .line;
|
self.selection_mode = .line;
|
||||||
primary.cursor.move_abs(root, &self.view, @intCast(y), @intCast(x), self.metrics) catch return;
|
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.selection_drag_initial = primary.selection;
|
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.collapse_cursors();
|
||||||
self.clamp_mouse();
|
self.clamp_mouse();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue