fix: don't allow double click to fail if select_word_at_cursor fails
This commit is contained in:
parent
e23d35b8c7
commit
3de4a47123
1 changed files with 3 additions and 2 deletions
|
|
@ -2623,8 +2623,9 @@ pub const Editor = struct {
|
||||||
primary.disable_selection(root, self.metrics);
|
primary.disable_selection(root, self.metrics);
|
||||||
self.selection_mode = .word;
|
self.selection_mode = .word;
|
||||||
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_word_at_cursor(primary);
|
self.selection_drag_initial = self.select_word_at_cursor(primary) catch |e| switch (e) {
|
||||||
self.selection_drag_initial = primary.selection;
|
error.Stop => primary.to_selection_normal(),
|
||||||
|
};
|
||||||
self.collapse_cursors();
|
self.collapse_cursors();
|
||||||
self.clamp_mouse();
|
self.clamp_mouse();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue