editor: Fix select when click on existing selection (#32365)

Follow-up for https://github.com/zed-industries/zed/pull/30671

Now, when clicking on an existing selection, the cursor will change on
`mouse_up` when `drag_and_drop_selection` is `true`. When
`drag_and_drop_selection` is `false`, it will change on `mouse_down`
(previous default).

Release Notes:

- N/A
This commit is contained in:
Smit Barmase 2025-06-09 11:58:06 +05:30 committed by GitHub
parent ebea734515
commit c57a6263aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 76 additions and 49 deletions

View file

@ -915,8 +915,8 @@ impl Vim {
if mode == Mode::Normal || mode != last_mode {
self.current_tx.take();
self.current_anchor.take();
self.update_editor(window, cx, |_, editor, window, cx| {
editor.drop_selection(None, false, window, cx);
self.update_editor(window, cx, |_, editor, _, _| {
editor.clear_selection_drag_state();
});
}
Vim::take_forced_motion(cx);