When clicking on a hunk expand it, do not move the caret (#11350)
Release Notes: - N/A
This commit is contained in:
parent
36055505cd
commit
f5e155b5a9
1 changed files with 5 additions and 3 deletions
|
@ -427,10 +427,12 @@ impl EditorElement {
|
||||||
let mut click_count = event.click_count;
|
let mut click_count = event.click_count;
|
||||||
let mut modifiers = event.modifiers;
|
let mut modifiers = event.modifiers;
|
||||||
|
|
||||||
if gutter_hitbox.is_hovered(cx) {
|
if let Some(hovered_hunk) = hovered_hunk {
|
||||||
click_count = 3; // Simulate triple-click when clicking the gutter to select lines
|
|
||||||
} else if let Some(hovered_hunk) = hovered_hunk {
|
|
||||||
editor.expand_diff_hunk(None, hovered_hunk, cx);
|
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) {
|
} else if !text_hitbox.is_hovered(cx) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue