mirror of https://github.com/lapce/lapce.git
code actions light bulb
This commit is contained in:
parent
e205a885c0
commit
56296d79c7
|
@ -834,7 +834,7 @@ fn paint_code_actions_hint(
|
||||||
let width = 14.0;
|
let width = 14.0;
|
||||||
let height = 14.0;
|
let height = 14.0;
|
||||||
let rect = Size::new(width, height).to_rect().with_origin(Point::new(
|
let rect = Size::new(width, height).to_rect().with_origin(Point::new(
|
||||||
(line_height - width) / 2.0 + 5.0 + data.editor.scroll_offset.x,
|
data.editor.scroll_offset.x,
|
||||||
(line_height - height) / 2.0 + line_height * line as f64,
|
(line_height - height) / 2.0 + line_height * line as f64,
|
||||||
));
|
));
|
||||||
svg.paint(ctx, rect, None);
|
svg.paint(ctx, rect, None);
|
||||||
|
@ -1320,6 +1320,17 @@ fn update(
|
||||||
ctx.request_paint_rect(rect);
|
ctx.request_paint_rect(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if old_data.current_code_actions().is_some()
|
||||||
|
!= data.current_code_actions().is_some()
|
||||||
|
{
|
||||||
|
let offset = data.editor.cursor.offset();
|
||||||
|
let (line, _) = data.buffer.offset_to_line_col(offset);
|
||||||
|
let rect = Rect::ZERO
|
||||||
|
.with_origin(Point::new(0.0, line as f64 * line_height))
|
||||||
|
.with_size(Size::new(ctx.size().width, line_height));
|
||||||
|
ctx.request_paint_rect(rect);
|
||||||
|
}
|
||||||
|
|
||||||
if old_data.on_diagnostic() != data.on_diagnostic() {
|
if old_data.on_diagnostic() != data.on_diagnostic() {
|
||||||
ctx.request_paint();
|
ctx.request_paint();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue