When clicking on a hunk expand it, do not move the caret (#11350)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-05-03 16:44:33 +03:00 committed by GitHub
parent 36055505cd
commit f5e155b5a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -427,10 +427,12 @@ impl EditorElement {
let mut click_count = event.click_count;
let mut modifiers = event.modifiers;
if gutter_hitbox.is_hovered(cx) {
click_count = 3; // Simulate triple-click when clicking the gutter to select lines
} else if let Some(hovered_hunk) = hovered_hunk {
if let Some(hovered_hunk) = hovered_hunk {
editor.expand_diff_hunk(None, hovered_hunk, cx);
cx.notify();
return;
} else if gutter_hitbox.is_hovered(cx) {
click_count = 3; // Simulate triple-click when clicking the gutter to select lines
} else if !text_hitbox.is_hovered(cx) {
return;
}