mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 04:20:46 +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,
|
click_count,
|
||||||
}));
|
}));
|
||||||
true
|
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 {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -829,6 +838,7 @@ impl Element for EditorElement {
|
||||||
|
|
||||||
Some(PaintState {
|
Some(PaintState {
|
||||||
bounds,
|
bounds,
|
||||||
|
gutter_bounds,
|
||||||
text_bounds,
|
text_bounds,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
@ -955,6 +965,7 @@ impl LayoutState {
|
||||||
|
|
||||||
pub struct PaintState {
|
pub struct PaintState {
|
||||||
bounds: RectF,
|
bounds: RectF,
|
||||||
|
gutter_bounds: RectF,
|
||||||
text_bounds: RectF,
|
text_bounds: RectF,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue