mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 11:29:25 +00:00
Simulate line-wise selection when clicking on the gutter
This commit is contained in:
parent
7a79df7a24
commit
63089badf1
1 changed files with 11 additions and 0 deletions
|
@ -70,6 +70,15 @@ impl EditorElement {
|
|||
click_count,
|
||||
}));
|
||||
true
|
||||
} else if paint.gutter_bounds.contains_point(position) {
|
||||
let snapshot = self.snapshot(cx.app);
|
||||
let position = paint.point_for_position(&snapshot, layout, position);
|
||||
cx.dispatch_action(Select(SelectPhase::Begin {
|
||||
position,
|
||||
add: cmd,
|
||||
click_count: 3,
|
||||
}));
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
@ -829,6 +838,7 @@ impl Element for EditorElement {
|
|||
|
||||
Some(PaintState {
|
||||
bounds,
|
||||
gutter_bounds,
|
||||
text_bounds,
|
||||
})
|
||||
} else {
|
||||
|
@ -955,6 +965,7 @@ impl LayoutState {
|
|||
|
||||
pub struct PaintState {
|
||||
bounds: RectF,
|
||||
gutter_bounds: RectF,
|
||||
text_bounds: RectF,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue