Fix alignment of code actions menu with narrow panes
This commit is contained in:
parent
68fe2bb776
commit
2671b9c63c
1 changed files with 4 additions and 0 deletions
|
@ -2082,6 +2082,10 @@ impl EditorElement {
|
||||||
crate::ContextMenuOrigin::GutterIndicator(row) => {
|
crate::ContextMenuOrigin::GutterIndicator(row) => {
|
||||||
// Context menu was spawned via a click on a gutter. Ensure it's a bit closer to the indicator than just a plain first column of the
|
// Context menu was spawned via a click on a gutter. Ensure it's a bit closer to the indicator than just a plain first column of the
|
||||||
// text field.
|
// text field.
|
||||||
|
let snapshot = self.editor.update(cx, |this, cx| this.snapshot(cx));
|
||||||
|
let row = Point::new(row, 0)
|
||||||
|
.to_display_point(&snapshot.display_snapshot)
|
||||||
|
.row();
|
||||||
let x = -gutter_overshoot;
|
let x = -gutter_overshoot;
|
||||||
let y = (row + 1) as f32 * line_height - scroll_pixel_position.y;
|
let y = (row + 1) as f32 * line_height - scroll_pixel_position.y;
|
||||||
(x, y)
|
(x, y)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue